Merge branch 'stable' into develop

This commit is contained in:
Jonas Herzig
2021-02-19 11:58:28 +01:00
20 changed files with 153 additions and 87 deletions

View File

@@ -476,6 +476,14 @@ public class ReplayMod implements
String name = path.getFileName().toString();
if (name.endsWith(".mcpr.tmp") && Files.isDirectory(path)) {
Path original = path.resolveSibling(FilenameUtils.getBaseName(name));
Path noRecoverMarker = original.resolveSibling(original.getFileName() + ".no_recover");
if (Files.exists(noRecoverMarker)) {
// This file, when its markers are processed, doesn't actually result in any replays.
// So we don't really need to recover it either, let's just get rid of it.
FileUtils.deleteDirectory(path.toFile());
Files.delete(noRecoverMarker);
continue;
}
new RestoreReplayGui(this, GuiScreen.wrap(mc.currentScreen), original.toFile()).display();
}
}

View File

@@ -80,9 +80,16 @@ import org.lwjgl.glfw.GLFW;
//$$ import java.io.IOException;
//#endif
//#if MC>=11400
import net.minecraft.client.sound.PositionedSoundInstance;
//#else
//$$ import net.minecraft.client.audio.PositionedSoundRecord;
//#endif
//#if MC>=10904
import com.replaymod.render.blend.mixin.ParticleAccessor;
import net.minecraft.client.particle.Particle;
import net.minecraft.sound.SoundEvent;
import net.minecraft.util.math.Vec3d;
//#endif
@@ -758,6 +765,20 @@ public class MCVer {
}
}
public static void playSound(Identifier sound) {
getMinecraft().getSoundManager().play(
//#if MC>=11400
PositionedSoundInstance.master(new SoundEvent(sound), 1.0F)
//#elseif MC>=10904
//$$ PositionedSoundRecord.getMasterRecord(new SoundEvent(sound), 1.0F)
//#elseif MC>=10800
//$$ PositionedSoundRecord.create(sound, 1.0F)
//#else
//$$ PositionedSoundRecord.createPositionedSoundRecord(sound, 1.0F)
//#endif
);
}
//#if MC>=11400
private static Boolean hasOptifine;
public static boolean hasOptifine() {