Port to MC 1.18.2 (closes #697)

This commit is contained in:
Jonas Herzig
2022-03-06 12:33:13 +01:00
parent 1fa027f362
commit 4aa667fe04
12 changed files with 60 additions and 8 deletions

View File

@@ -648,7 +648,11 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
//#if MC>=11600
//#if MC>=11603
packet.getDimensionIds(),
//#if MC>=11800
//$$ packet.registryManager(),
//#else
(net.minecraft.util.registry.DynamicRegistryManager.Impl) packet.getRegistryManager(),
//#endif
packet.getDimensionType(),
//#else
//$$ packet.method_29443(),

View File

@@ -8,6 +8,10 @@ import com.replaymod.replay.camera.CameraEntity;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.RenderTickCounter;
//#if MC>=11802
//$$ import net.minecraft.client.gui.screen.DownloadingTerrainScreen;
//#endif
//#if MC>=11400
import org.lwjgl.glfw.GLFW;
//#else
@@ -111,6 +115,15 @@ public class InputReplayTimer extends WrappedTimer {
//#endif
//$$ }
//#endif
//#if MC>=11802
//$$ // As of 1.18.2, this screen always stays open for at least two seconds, and requires ticking to close.
//$$ // Thanks, but we'll have none of that (at least while in a replay).
//$$ if (mc.currentScreen instanceof DownloadingTerrainScreen) {
//$$ mc.currentScreen.close();
//$$ }
//#endif
}
//#if MC>=11600
return ticksThisFrame;

View File

@@ -31,6 +31,10 @@ import net.minecraft.stat.StatHandler;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.Box;
//#if MC>=11802
//$$ import net.minecraft.tag.TagKey;
//#endif
//#if FABRIC>=1
//#else
//$$ import net.minecraftforge.client.event.EntityViewRenderEvent;
@@ -354,7 +358,13 @@ public class CameraEntity
//#if MC>=11400
@Override
public boolean isSubmergedIn(Tag<Fluid> fluid) {
public boolean isSubmergedIn(
//#if MC>=11802
//$$ TagKey<Fluid> fluid
//#else
Tag<Fluid> fluid
//#endif
) {
return falseUnlessSpectating(entity -> entity.isSubmergedIn(fluid));
}

View File

@@ -18,7 +18,7 @@ public abstract class MixinGuiSpectator {
//$$ @Inject(method = "func_175260_a", at = @At("HEAD"), cancellable = true)
//#endif
public void isInReplay(
//#if MC>=11400
//#if MC>=11400 && MC<11802
double i,
//#else
//$$ int i,