./gradlew :1.16.2:setCoreVersion

This commit is contained in:
Jonas Herzig
2020-08-28 14:54:53 +02:00
parent 9001fdc9de
commit c2f51d41fa
36 changed files with 233 additions and 233 deletions

2
jGui

Submodule jGui updated: 8c026e191b...e9387ad003

View File

@@ -8,8 +8,8 @@ import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
//#if MC>=11600 //#if MC>=11600
//$$ import net.minecraft.client.render.Camera; import net.minecraft.client.render.Camera;
//$$ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;
//#endif //#endif
//#if MC>=11400 //#if MC>=11400
@@ -30,12 +30,12 @@ public abstract class MixinShadersRender {
private static void replayModCompat_disableRenderHand0( private static void replayModCompat_disableRenderHand0(
GameRenderer er, GameRenderer er,
//#if MC>=11600 //#if MC>=11600
//$$ MatrixStack stack, MatrixStack stack,
//$$ Camera camera, Camera camera,
//#endif //#endif
float partialTicks, float partialTicks,
//#if MC<11600 //#if MC<11600
int renderPass, //$$ int renderPass,
//#endif //#endif
CallbackInfo ci) { CallbackInfo ci) {
//#if MC>=11400 //#if MC>=11400

View File

@@ -657,13 +657,13 @@ public class ReplayMod implements
// Some nostalgia: "§8[§6Replay Mod§8]§r Your message goes here" // Some nostalgia: "§8[§6Replay Mod§8]§r Your message goes here"
//#if MC>=10904 //#if MC>=10904
//#if MC>=11600 //#if MC>=11600
//$$ Style coloredDarkGray = Style.EMPTY.withColor(Formatting.DARK_GRAY); Style coloredDarkGray = Style.EMPTY.withColor(Formatting.DARK_GRAY);
//$$ Style coloredGold = Style.EMPTY.withColor(Formatting.GOLD); Style coloredGold = Style.EMPTY.withColor(Formatting.GOLD);
//$$ Style alert = Style.EMPTY.withColor(warning ? Formatting.RED : Formatting.DARK_GREEN); Style alert = Style.EMPTY.withColor(warning ? Formatting.RED : Formatting.DARK_GREEN);
//#else //#else
Style coloredDarkGray = new Style().setColor(Formatting.DARK_GRAY); //$$ Style coloredDarkGray = new Style().setColor(Formatting.DARK_GRAY);
Style coloredGold = new Style().setColor(Formatting.GOLD); //$$ Style coloredGold = new Style().setColor(Formatting.GOLD);
Style alert = new Style().setColor(warning ? Formatting.RED : Formatting.DARK_GREEN); //$$ Style alert = new Style().setColor(warning ? Formatting.RED : Formatting.DARK_GREEN);
//#endif //#endif
Text text = new LiteralText("[").setStyle(coloredDarkGray) Text text = new LiteralText("[").setStyle(coloredDarkGray)
.append(new TranslatableText("replaymod.title").setStyle(coloredGold)) .append(new TranslatableText("replaymod.title").setStyle(coloredGold))

View File

@@ -12,7 +12,7 @@ import java.util.List;
import static com.replaymod.core.versions.MCVer.*; import static com.replaymod.core.versions.MCVer.*;
//#if MC>=11400 && MC<11600 //#if MC>=11400 && MC<11600
import net.minecraft.realms.RealmsScreenProxy; //$$ import net.minecraft.realms.RealmsScreenProxy;
//#endif //#endif
//#if FABRIC>=1 //#if FABRIC>=1
@@ -72,53 +72,53 @@ public class MainMenuHandler extends EventRegistrations {
//#endif //#endif
} }
//#if MC>=11400 && MC<11600 //#if MC>=11400 && MC<11600
GuiMainMenuAccessor guiA = (GuiMainMenuAccessor) gui; //$$ GuiMainMenuAccessor guiA = (GuiMainMenuAccessor) gui;
if (realmsOffset != 0 && guiA.getRealmsNotification() instanceof RealmsScreenProxy) { //$$ if (realmsOffset != 0 && guiA.getRealmsNotification() instanceof RealmsScreenProxy) {
guiA.setRealmsNotification(new RealmsNotificationProxy((RealmsScreenProxy) guiA.getRealmsNotification(), realmsOffset)); //$$ guiA.setRealmsNotification(new RealmsNotificationProxy((RealmsScreenProxy) guiA.getRealmsNotification(), realmsOffset));
} //$$ }
//#endif //#endif
} }
} }
//#if MC>=11400 && MC<11600 //#if MC>=11400 && MC<11600
private static class RealmsNotificationProxy extends Screen { //$$ private static class RealmsNotificationProxy extends Screen {
private final RealmsScreenProxy proxy; //$$ private final RealmsScreenProxy proxy;
private final int offset; //$$ private final int offset;
//$$
private RealmsNotificationProxy(RealmsScreenProxy proxy, int offset) { //$$ private RealmsNotificationProxy(RealmsScreenProxy proxy, int offset) {
//#if MC>=11400 //#if MC>=11400
super(null); //$$ super(null);
//#endif //#endif
this.proxy = proxy; //$$ this.proxy = proxy;
this.offset = offset; //$$ this.offset = offset;
} //$$ }
//$$
@Override //$$ @Override
public void init(MinecraftClient mc, int width, int height) { //$$ public void init(MinecraftClient mc, int width, int height) {
proxy.init(mc, width, height); //$$ proxy.init(mc, width, height);
} //$$ }
//$$
@Override //$$ @Override
public void tick() { //$$ public void tick() {
proxy.tick(); //$$ proxy.tick();
} //$$ }
//$$
@Override //$$ @Override
public void render(int mouseX, int mouseY, float partialTicks) { //$$ public void render(int mouseX, int mouseY, float partialTicks) {
GL11.glTranslated(0, offset, 0); //$$ GL11.glTranslated(0, offset, 0);
proxy.render(mouseX, mouseY - offset, partialTicks); //$$ proxy.render(mouseX, mouseY - offset, partialTicks);
GL11.glTranslated(0, -offset, 0); //$$ GL11.glTranslated(0, -offset, 0);
} //$$ }
//$$
@Override //$$ @Override
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) { //$$ public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) {
return proxy.mouseClicked(mouseX, mouseY - offset, mouseButton); //$$ return proxy.mouseClicked(mouseX, mouseY - offset, mouseButton);
} //$$ }
//$$
@Override //$$ @Override
public void removed() { //$$ public void removed() {
proxy.removed(); //$$ proxy.removed();
} //$$ }
} //$$ }
//#endif //#endif
} }

View File

@@ -11,7 +11,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(Keyboard.class) @Mixin(Keyboard.class)
public class MixinKeyboardListener { public class MixinKeyboardListener {
@Inject(method = "onKey", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/options/KeyBinding;onKeyPressed(Lnet/minecraft/client/util/InputUtil$KeyCode;)V", shift = At.Shift.AFTER)) @Inject(method = "onKey", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/options/KeyBinding;onKeyPressed(Lnet/minecraft/client/util/InputUtil$Key;)V", shift = At.Shift.AFTER))
private void afterKeyBindingTick(long windowPointer, int key, int scanCode, int action, int modifiers, CallbackInfo ci) { private void afterKeyBindingTick(long windowPointer, int key, int scanCode, int action, int modifiers, CallbackInfo ci) {
KeyBindingEventCallback.EVENT.invoker().onKeybindingEvent(); KeyBindingEventCallback.EVENT.invoker().onKeybindingEvent();
KeyEventCallback.EVENT.invoker().onKeyEvent(key, scanCode, action, modifiers); KeyEventCallback.EVENT.invoker().onKeyEvent(key, scanCode, action, modifiers);

View File

@@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(Mouse.class) @Mixin(Mouse.class)
public class MixinMouse { public class MixinMouse {
@Inject(method = "onMouseButton", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/options/KeyBinding;onKeyPressed(Lnet/minecraft/client/util/InputUtil$KeyCode;)V", shift = At.Shift.AFTER)) @Inject(method = "onMouseButton", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/options/KeyBinding;onKeyPressed(Lnet/minecraft/client/util/InputUtil$Key;)V", shift = At.Shift.AFTER))
private void afterKeyBindingTick(CallbackInfo ci) { private void afterKeyBindingTick(CallbackInfo ci) {
KeyBindingEventCallback.EVENT.invoker().onKeybindingEvent(); KeyBindingEventCallback.EVENT.invoker().onKeybindingEvent();
} }

View File

@@ -45,7 +45,7 @@ public class Mixin_ContextualKeyBindings {
} else { } else {
// Not in a replay, remove all replay-exclusive keybindings // Not in a replay, remove all replay-exclusive keybindings
for (KeyBinding keyBinding : onlyInReplay) { for (KeyBinding keyBinding : onlyInReplay) {
if (Mixin_ContextualKeyBindings.keysById.remove(keyBinding.getId()) != null) { if (Mixin_ContextualKeyBindings.keysById.remove(keyBinding.getTranslationKey()) != null) {
temporarilyRemoved.add(keyBinding); temporarilyRemoved.add(keyBinding);
} }
} }
@@ -55,7 +55,7 @@ public class Mixin_ContextualKeyBindings {
@Inject(method = "updateKeysByCode", at = @At("RETURN")) @Inject(method = "updateKeysByCode", at = @At("RETURN"))
private static void postContextualKeyBindings(CallbackInfo ci) { private static void postContextualKeyBindings(CallbackInfo ci) {
for (KeyBinding keyBinding : temporarilyRemoved) { for (KeyBinding keyBinding : temporarilyRemoved) {
Mixin_ContextualKeyBindings.keysById.put(keyBinding.getId(), keyBinding); Mixin_ContextualKeyBindings.keysById.put(keyBinding.getTranslationKey(), keyBinding);
} }
temporarilyRemoved.clear(); temporarilyRemoved.clear();
} }

View File

@@ -1,7 +1,7 @@
package com.replaymod.core.utils; package com.replaymod.core.utils;
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket; import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
import net.minecraft.util.PacketByteBuf; import net.minecraft.network.PacketByteBuf;
//#if MC>=10904 //#if MC>=10904
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
//#endif //#endif

View File

@@ -21,9 +21,9 @@ public class WrappedTimer extends RenderTickCounter {
@Override @Override
public public
//#if MC>=11600 //#if MC>=11600
//$$ int int
//#else //#else
void //$$ void
//#endif //#endif
beginRenderTick( beginRenderTick(
//#if MC>=11400 //#if MC>=11400
@@ -33,7 +33,7 @@ public class WrappedTimer extends RenderTickCounter {
copy(this, wrapped); copy(this, wrapped);
try { try {
//#if MC>=11600 //#if MC>=11600
//$$ return return
//#endif //#endif
wrapped.beginRenderTick( wrapped.beginRenderTick(
//#if MC>=11400 //#if MC>=11400
@@ -50,7 +50,7 @@ public class WrappedTimer extends RenderTickCounter {
TimerAccessor toA = (TimerAccessor) to; TimerAccessor toA = (TimerAccessor) to;
//#if MC<11600 //#if MC<11600
to.ticksThisFrame = from.ticksThisFrame; //$$ to.ticksThisFrame = from.ticksThisFrame;
//#endif //#endif
to.tickDelta = from.tickDelta; to.tickDelta = from.tickDelta;
toA.setLastSyncSysClock(fromA.getLastSyncSysClock()); toA.setLastSyncSysClock(fromA.getLastSyncSysClock());

View File

@@ -14,7 +14,7 @@ import net.minecraft.client.model.ModelPart;
import net.minecraft.util.crash.CrashReportSection; import net.minecraft.util.crash.CrashReportSection;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.PacketByteBuf; import net.minecraft.network.PacketByteBuf;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.minecraft.util.Util; import net.minecraft.util.Util;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
@@ -24,7 +24,7 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
//#if MC>=11600 //#if MC>=11600
//$$ import net.minecraft.resource.ResourcePackSource; import net.minecraft.resource.ResourcePackSource;
//#endif //#endif
//#if MC>=11500 //#if MC>=11500
@@ -44,9 +44,9 @@ import net.minecraft.client.gui.widget.AbstractButtonWidget;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
//#if MC>=11600 //#if MC>=11600
//$$ import net.minecraft.text.TranslatableText; import net.minecraft.text.TranslatableText;
//#else //#else
import net.minecraft.client.resource.language.I18n; //$$ import net.minecraft.client.resource.language.I18n;
//#endif //#endif
//#else //#else
//$$ import com.google.common.util.concurrent.FutureCallback; //$$ import com.google.common.util.concurrent.FutureCallback;
@@ -448,7 +448,7 @@ public class MCVer {
return getMinecraft().getResourcePackDownloader().loadServerPack( return getMinecraft().getResourcePackDownloader().loadServerPack(
file file
//#if MC>=11600 //#if MC>=11600
//$$ , ResourcePackSource.PACK_SOURCE_SERVER , ResourcePackSource.PACK_SOURCE_SERVER
//#endif //#endif
); );
//#else //#else
@@ -574,7 +574,7 @@ public class MCVer {
public static EntityRenderDispatcher getRenderManager() { public static EntityRenderDispatcher getRenderManager() {
//#if MC>=10800 //#if MC>=10800
return getMinecraft().getEntityRenderManager(); return getMinecraft().getEntityRenderDispatcher();
//#else //#else
//$$ return RenderManager.instance; //$$ return RenderManager.instance;
//#endif //#endif
@@ -613,9 +613,9 @@ public class MCVer {
//#if MC>=11400 //#if MC>=11400
public static Optional<AbstractButtonWidget> findButton(List<AbstractButtonWidget> buttonList, @SuppressWarnings("unused") String text, @SuppressWarnings("unused") int id) { public static Optional<AbstractButtonWidget> findButton(List<AbstractButtonWidget> buttonList, @SuppressWarnings("unused") String text, @SuppressWarnings("unused") int id) {
//#if MC>=11600 //#if MC>=11600
//$$ final TranslatableText message = new TranslatableText(text); final TranslatableText message = new TranslatableText(text);
//#else //#else
final String message = I18n.translate(text); //$$ final String message = I18n.translate(text);
//#endif //#endif
for (AbstractButtonWidget b : buttonList) { for (AbstractButtonWidget b : buttonList) {
if (message.equals(b.getMessage())) { if (message.equals(b.getMessage())) {

View File

@@ -74,7 +74,7 @@ public class HotkeyButtons extends EventRegistrations implements Extra {
final KeyBindingRegistry keyBindingRegistry = mod.getKeyBindingRegistry(); final KeyBindingRegistry keyBindingRegistry = mod.getKeyBindingRegistry();
keyBindingRegistry.getKeyBindings().values().stream() keyBindingRegistry.getKeyBindings().values().stream()
.sorted(Comparator.comparing(it -> I18n.translate(it.getId()))) .sorted(Comparator.comparing(it -> I18n.translate(it.getTranslationKey())))
.forEachOrdered(keyBinding -> { .forEachOrdered(keyBinding -> {
GuiButton button = new GuiButton(){ GuiButton button = new GuiButton(){
@Override @Override
@@ -83,10 +83,10 @@ public class HotkeyButtons extends EventRegistrations implements Extra {
String keyName = "???"; String keyName = "???";
try { try {
//#if MC>=11600 //#if MC>=11600
//$$ keyName = keyBinding.getBoundKeyLocalizedText().asString(); keyName = keyBinding.getBoundKeyLocalizedText().asString();
//#else //#else
//#if MC>=11400 //#if MC>=11400
keyName = keyBinding.getLocalizedName(); //$$ keyName = keyBinding.getLocalizedName();
//#else //#else
//$$ keyName = Keyboard.getKeyName(keyBinding.getKeyCode()); //$$ keyName = Keyboard.getKeyName(keyBinding.getKeyCode());
//#endif //#endif
@@ -115,7 +115,7 @@ public class HotkeyButtons extends EventRegistrations implements Extra {
return new Dimension(Math.max(10, button.getMinSize().getWidth()) + 10, 20); return new Dimension(Math.max(10, button.getMinSize().getWidth()) + 10, 20);
} }
}).addElements(null, button), }).addElements(null, button),
new GuiLabel().setI18nText(keyBinding.getId()) new GuiLabel().setI18nText(keyBinding.getTranslationKey())
)); ));
}); });

View File

@@ -15,7 +15,7 @@ public class ReplayTimer extends WrappedTimer {
//#endif //#endif
//#if MC>=11600 //#if MC>=11600
//$$ public int ticksThisFrame; public int ticksThisFrame;
//#endif //#endif
public ReplayTimer(RenderTickCounter wrapped) { public ReplayTimer(RenderTickCounter wrapped) {
@@ -27,9 +27,9 @@ public class ReplayTimer extends WrappedTimer {
//#if MC>=11400 //#if MC>=11400
public public
//#if MC>=11600 //#if MC>=11600
//$$ int int
//#else //#else
void //$$ void
//#endif //#endif
beginRenderTick( beginRenderTick(
//#else //#else
@@ -42,7 +42,7 @@ public class ReplayTimer extends WrappedTimer {
copy(this, state); // Save our current state copy(this, state); // Save our current state
try { try {
//#if MC>=11600 //#if MC>=11600
//$$ ticksThisFrame = ticksThisFrame =
//#endif //#endif
wrapped.beginRenderTick( wrapped.beginRenderTick(
//#if MC>=11400 //#if MC>=11400
@@ -54,7 +54,7 @@ public class ReplayTimer extends WrappedTimer {
UpdatedCallback.EVENT.invoker().onUpdate(); UpdatedCallback.EVENT.invoker().onUpdate();
} }
//#if MC>=11600 //#if MC>=11600
//$$ return ticksThisFrame; return ticksThisFrame;
//#endif //#endif
} }

View File

@@ -56,7 +56,7 @@ public class GuiRecordingOverlay extends EventRegistrations {
String text = guiControls.isPaused() ? I18n.translate("replaymod.gui.paused") : I18n.translate("replaymod.gui.recording"); String text = guiControls.isPaused() ? I18n.translate("replaymod.gui.paused") : I18n.translate("replaymod.gui.recording");
fontRenderer.draw( fontRenderer.draw(
//#if MC>=11600 //#if MC>=11600
//$$ stack, stack,
//#endif //#endif
text.toUpperCase(), 30, 18 - (fontRenderer.fontHeight / 2), 0xffffffff); text.toUpperCase(), 30, 18 - (fontRenderer.fontHeight / 2), 0xffffffff);
bindTexture(TEXTURE); bindTexture(TEXTURE);

View File

@@ -19,14 +19,14 @@ import net.minecraft.network.ClientConnection;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
//#if MC>=11600 //#if MC>=11600
//$$ import net.minecraft.world.World; import net.minecraft.world.World;
//#else //#else
//#if MC>=11400 //#if MC>=11400
import net.minecraft.world.dimension.DimensionType; //$$ import net.minecraft.world.dimension.DimensionType;
//#endif //#endif
//$$
//#if MC>=10800 //#if MC>=10800
import net.minecraft.world.level.LevelGeneratorType; //$$ import net.minecraft.world.level.LevelGeneratorType;
//#endif //#endif
//#endif //#endif
@@ -65,10 +65,10 @@ public class ConnectionEventHandler {
if (local) { if (local) {
//#if MC>=10800 //#if MC>=10800
//#if MC>=11600 //#if MC>=11600
//$$ if (mc.getServer().getWorld(World.OVERWORLD).isDebugWorld()) { if (mc.getServer().getWorld(World.OVERWORLD).isDebugWorld()) {
//#else //#else
//#if MC>=11400 //#if MC>=11400
if (mc.getServer().getWorld(DimensionType.OVERWORLD).getGeneratorType() == LevelGeneratorType.DEBUG_ALL_BLOCK_STATES) { //$$ if (mc.getServer().getWorld(DimensionType.OVERWORLD).getGeneratorType() == LevelGeneratorType.DEBUG_ALL_BLOCK_STATES) {
//#else //#else
//$$ if (mc.getIntegratedServer().getEntityWorld().getWorldType() == WorldType.DEBUG_ALL_BLOCK_STATES) { //$$ if (mc.getIntegratedServer().getEntityWorld().getWorldType() == WorldType.DEBUG_ALL_BLOCK_STATES) {
//#endif //#endif
@@ -91,9 +91,9 @@ public class ConnectionEventHandler {
String worldName; String worldName;
if (local) { if (local) {
//#if MC>=11600 //#if MC>=11600
//$$ worldName = mc.getServer().getSaveProperties().getLevelName(); worldName = mc.getServer().getSaveProperties().getLevelName();
//#else //#else
worldName = mc.getServer().getLevelName(); //$$ worldName = mc.getServer().getLevelName();
//#endif //#endif
} else if (mc.getCurrentServerEntry() != null) { } else if (mc.getCurrentServerEntry() != null) {
worldName = mc.getCurrentServerEntry().address; worldName = mc.getCurrentServerEntry().address;

View File

@@ -32,8 +32,8 @@ import de.johni0702.minecraft.gui.versions.callbacks.PreTickCallback;
//#endif //#endif
//#if MC>=11600 //#if MC>=11600
//$$ import com.mojang.datafixers.util.Pair; import com.mojang.datafixers.util.Pair;
//$$ import java.util.Collections; import java.util.Collections;
//#endif //#endif
//#if MC>=11400 //#if MC>=11400
@@ -210,10 +210,10 @@ public class RecordingEventHandler extends EventRegistrations {
//#endif //#endif
newYaw, newPitch newYaw, newPitch
//#if MC>=11600 //#if MC>=11600
//$$ , player.isOnGround() , player.isOnGround()
//#else //#else
//#if MC>=10800 //#if MC>=10800
, player.onGround //$$ , player.onGround
//#endif //#endif
//#endif //#endif
); );
@@ -239,7 +239,7 @@ public class RecordingEventHandler extends EventRegistrations {
//Animation Packets //Animation Packets
//Swing Animation //Swing Animation
if (player.isHandSwinging && player.handSwingTicks == 0) { if (player.handSwinging && player.handSwingTicks == 0) {
packetListener.save(new EntityAnimationS2CPacket( packetListener.save(new EntityAnimationS2CPacket(
player, player,
//#if MC>=10904 //#if MC>=10904
@@ -277,9 +277,9 @@ public class RecordingEventHandler extends EventRegistrations {
if (playerItems[slot.ordinal()] != stack) { if (playerItems[slot.ordinal()] != stack) {
playerItems[slot.ordinal()] = stack; playerItems[slot.ordinal()] = stack;
//#if MC>=11600 //#if MC>=11600
//$$ packetListener.save(new EntityEquipmentUpdateS2CPacket(player.getEntityId(), Collections.singletonList(Pair.of(slot, stack)))); packetListener.save(new EntityEquipmentUpdateS2CPacket(player.getEntityId(), Collections.singletonList(Pair.of(slot, stack))));
//#else //#else
packetListener.save(new EntityEquipmentUpdateS2CPacket(player.getEntityId(), slot, stack)); //$$ packetListener.save(new EntityEquipmentUpdateS2CPacket(player.getEntityId(), slot, stack));
//#endif //#endif
} }
} }

View File

@@ -10,7 +10,7 @@ import org.spongepowered.asm.mixin.injection.At;
import java.io.File; import java.io.File;
//#if MC>=11600 //#if MC>=11600
//$$ import net.minecraft.resource.ResourcePackSource; import net.minecraft.resource.ResourcePackSource;
//#endif //#endif
//#if MC>=10800 //#if MC>=10800
@@ -37,7 +37,7 @@ public abstract class MixinDownloadingPackFinder implements ResourcePackRecorder
private void recordDownloadedPack( private void recordDownloadedPack(
File file, File file,
//#if MC>=11600 //#if MC>=11600
//$$ ResourcePackSource arg, ResourcePackSource arg,
//#endif //#endif
CallbackInfoReturnable ci CallbackInfoReturnable ci
) { ) {

View File

@@ -14,13 +14,13 @@ import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
@Mixin(Mouse.class) @Mixin(Mouse.class)
public abstract class MixinMouseHelper { public abstract class MixinMouseHelper {
@Shadow @Shadow
private boolean isCursorLocked; private boolean cursorLocked;
@Inject(method = "lockCursor", at = @At("HEAD"), cancellable = true) @Inject(method = "lockCursor", at = @At("HEAD"), cancellable = true)
private void noGrab(CallbackInfo ci) { private void noGrab(CallbackInfo ci) {
// Used to be provided by Forge for 1.12.2 and below // Used to be provided by Forge for 1.12.2 and below
if (Boolean.valueOf(System.getProperty("fml.noGrab", "false"))) { if (Boolean.valueOf(System.getProperty("fml.noGrab", "false"))) {
this.isCursorLocked = true; this.cursorLocked = true;
ci.cancel(); ci.cancel();
} }
} }

View File

@@ -17,7 +17,7 @@ import com.replaymod.replaystudio.protocol.PacketType;
import com.replaymod.replaystudio.protocol.packets.PacketPlayerListEntry; import com.replaymod.replaystudio.protocol.packets.PacketPlayerListEntry;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
import net.minecraft.util.PacketByteBuf; import net.minecraft.network.PacketByteBuf;
import net.minecraft.network.packet.s2c.play.PlayerListS2CPacket; import net.minecraft.network.packet.s2c.play.PlayerListS2CPacket;
import net.minecraft.client.network.PlayerListEntry; import net.minecraft.client.network.PlayerListEntry;

View File

@@ -17,17 +17,17 @@ import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
//#if MC>=11600 //#if MC>=11600
//$$ import net.minecraft.util.registry.RegistryKey; import net.minecraft.util.registry.RegistryKey;
//$$ import net.minecraft.world.MutableWorldProperties; import net.minecraft.world.MutableWorldProperties;
//$$ import java.util.function.Supplier; import java.util.function.Supplier;
//#else //#else
import net.minecraft.world.level.LevelProperties; //$$ import net.minecraft.world.level.LevelProperties;
//#endif //#endif
//#if MC>=11400 //#if MC>=11400
import net.minecraft.world.chunk.ChunkManager; import net.minecraft.world.chunk.ChunkManager;
//#if MC<11600 //#if MC<11600
import net.minecraft.world.dimension.Dimension; //$$ import net.minecraft.world.dimension.Dimension;
//#endif //#endif
import net.minecraft.world.dimension.DimensionType; import net.minecraft.world.dimension.DimensionType;
import java.util.function.BiFunction; import java.util.function.BiFunction;
@@ -48,22 +48,22 @@ public abstract class MixinWorldClient extends World implements RecordingEventHa
private MinecraftClient client; private MinecraftClient client;
//#if MC>=11600 //#if MC>=11600
//$$ protected MixinWorldClient(MutableWorldProperties mutableWorldProperties, RegistryKey<World> registryKey, protected MixinWorldClient(MutableWorldProperties mutableWorldProperties, RegistryKey<World> registryKey,
//#if MC<11602 //#if MC<11602
//$$ RegistryKey<DimensionType> registryKey2, //$$ RegistryKey<DimensionType> registryKey2,
//#endif //#endif
//$$ DimensionType dimensionType, Supplier<Profiler> profiler, boolean bl, boolean bl2, long l) { DimensionType dimensionType, Supplier<Profiler> profiler, boolean bl, boolean bl2, long l) {
//$$ super(mutableWorldProperties, registryKey, super(mutableWorldProperties, registryKey,
//#if MC<11602 //#if MC<11602
//$$ registryKey2, //$$ registryKey2,
//#endif //#endif
//$$ dimensionType, profiler, bl, bl2, l); dimensionType, profiler, bl, bl2, l);
//$$ } }
//#else //#else
//#if MC>=11400 //#if MC>=11400
protected MixinWorldClient(LevelProperties levelProperties_1, DimensionType dimensionType_1, BiFunction<World, Dimension, ChunkManager> biFunction_1, Profiler profiler_1, boolean boolean_1) { //$$ protected MixinWorldClient(LevelProperties levelProperties_1, DimensionType dimensionType_1, BiFunction<World, Dimension, ChunkManager> biFunction_1, Profiler profiler_1, boolean boolean_1) {
super(levelProperties_1, dimensionType_1, biFunction_1, profiler_1, boolean_1); //$$ super(levelProperties_1, dimensionType_1, biFunction_1, profiler_1, boolean_1);
} //$$ }
//#else //#else
//$$ protected MixinWorldClient(ISaveHandler saveHandlerIn, //$$ protected MixinWorldClient(ISaveHandler saveHandlerIn,
//#if MC>=11400 //#if MC>=11400
@@ -118,9 +118,9 @@ public abstract class MixinWorldClient extends World implements RecordingEventHa
// Same goes for level events (also called effects). E.g. door open, block break, etc. // Same goes for level events (also called effects). E.g. door open, block break, etc.
//#if MC>=11400 //#if MC>=11400
//#if MC>=11600 //#if MC>=11600
//$$ @Inject(method = "syncWorldEvent", at = @At("HEAD")) @Inject(method = "syncWorldEvent", at = @At("HEAD"))
//#else //#else
@Inject(method = "playLevelEvent", at = @At("HEAD")) //$$ @Inject(method = "playLevelEvent", at = @At("HEAD"))
//#endif //#endif
private void playLevelEvent (PlayerEntity player, int type, BlockPos pos, int data, CallbackInfo ci) { private void playLevelEvent (PlayerEntity player, int type, BlockPos pos, int data, CallbackInfo ci) {
//#else //#else

View File

@@ -36,7 +36,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.data.DataTracker; import net.minecraft.entity.data.DataTracker;
import net.minecraft.network.NetworkState; import net.minecraft.network.NetworkState;
import net.minecraft.network.Packet; import net.minecraft.network.Packet;
import net.minecraft.util.PacketByteBuf; import net.minecraft.network.PacketByteBuf;
import net.minecraft.text.LiteralText; import net.minecraft.text.LiteralText;
import net.minecraft.util.crash.CrashReport; import net.minecraft.util.crash.CrashReport;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;

View File

@@ -140,7 +140,7 @@ public class Util {
public static Vector3f getCameraPos() { public static Vector3f getCameraPos() {
MinecraftClient mc = MinecraftClient.getInstance(); MinecraftClient mc = MinecraftClient.getInstance();
//#if MC>=11400 //#if MC>=11400
Vec3d pos = mc.getEntityRenderManager().camera.getPos(); Vec3d pos = mc.getEntityRenderDispatcher().camera.getPos();
return new Vector3f((float) pos.x, (float) pos.y, (float) pos.z); return new Vector3f((float) pos.x, (float) pos.y, (float) pos.z);
//#else //#else
//$$ return new Vector3f( //$$ return new Vector3f(

View File

@@ -52,9 +52,9 @@ public class TileEntityExporter implements Exporter {
// so we position it at 0/0/0 and instead have the tile entities themselves move more // so we position it at 0/0/0 and instead have the tile entities themselves move more
Matrix4f.translate(new Vector3f( Matrix4f.translate(new Vector3f(
//#if MC>=11400 //#if MC>=11400
(float) -mc.getEntityRenderManager().camera.getPos().x, (float) -mc.getEntityRenderDispatcher().camera.getPos().x,
(float) -mc.getEntityRenderManager().camera.getPos().y, (float) -mc.getEntityRenderDispatcher().camera.getPos().y,
(float) -mc.getEntityRenderManager().camera.getPos().z (float) -mc.getEntityRenderDispatcher().camera.getPos().z
//#else //#else
//$$ (float) -mc.getRenderManager().viewerPosX, //$$ (float) -mc.getRenderManager().viewerPosX,
//$$ (float) -mc.getRenderManager().viewerPosY, //$$ (float) -mc.getRenderManager().viewerPosY,

View File

@@ -289,7 +289,7 @@ public class GuiVideoRenderer extends GuiScreen implements Tickable {
buffer.get(); // alpha buffer.get(); // alpha
//#if MC>=11400 //#if MC>=11400
int value = 0xff << 24 | b << 16 | g << 8 | r; int value = 0xff << 24 | b << 16 | g << 8 | r;
data.setPixelRgba(x, y, value); // actually takes ABGR, not RGBA data.setPixelColor(x, y, value); // actually takes ABGR, not RGBA
//#else //#else
//$$ int value = 0xff << 24 | r << 16 | g << 8 | b; //$$ int value = 0xff << 24 | r << 16 | g << 8 | b;
//$$ data[y * width + x] = value; //$$ data[y * width + x] = value;

View File

@@ -26,7 +26,7 @@ import net.minecraft.util.hit.HitResult;
//#if MC>=11400 //#if MC>=11400
import net.minecraft.client.options.GameOptions; import net.minecraft.client.options.GameOptions;
import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.util.math.Matrix4f; import net.minecraft.util.math.Matrix4f;
import net.minecraft.client.render.WorldRenderer; import net.minecraft.client.render.WorldRenderer;
//#else //#else
//$$ import com.replaymod.replay.camera.CameraEntity; //$$ import com.replaymod.replay.camera.CameraEntity;
@@ -217,7 +217,7 @@ public abstract class MixinEntityRenderer implements EntityRendererHandler.IEnti
*/ */
//#if MC>=11400 //#if MC>=11400
@Redirect(method = "method_22973", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/math/Matrix4f;viewboxMatrix(DFFF)Lnet/minecraft/client/util/math/Matrix4f;")) @Redirect(method = "method_22973", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/Matrix4f;viewboxMatrix(DFFF)Lnet/minecraft/util/math/Matrix4f;"))
private Matrix4f replayModRender_perspective$0(double fovY, float aspect, float zNear, float zFar) { private Matrix4f replayModRender_perspective$0(double fovY, float aspect, float zNear, float zFar) {
return replayModRender_perspective((float) fovY, aspect, zNear, zFar); return replayModRender_perspective((float) fovY, aspect, zNear, zFar);
} }

View File

@@ -46,7 +46,7 @@ public abstract class MixinParticleManager {
buildGeometry(particle, vertexConsumer, camera, partialTicks); buildGeometry(particle, vertexConsumer, camera, partialTicks);
} finally { } finally {
rotation.set(org.getA(), org.getB(), org.getC(), org.getD()); rotation.set(org.getW(), org.getX(), org.getY(), org.getZ());
} }
} }
} }

View File

@@ -33,7 +33,7 @@ import net.minecraft.sound.SoundCategory;
import net.minecraft.client.render.RenderTickCounter; import net.minecraft.client.render.RenderTickCounter;
//#if MC>=11600 //#if MC>=11600
//$$ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;
//#endif //#endif
//#if MC>=11500 //#if MC>=11500
@@ -167,7 +167,7 @@ public class VideoRenderer implements RenderInfo {
//#endif //#endif
while (replayTime < videoStart) { while (replayTime < videoStart) {
//#if MC<11600 //#if MC<11600
timer.ticksThisFrame = 1; //$$ timer.ticksThisFrame = 1;
//#endif //#endif
replayTime += 50; replayTime += 50;
replayHandler.getReplaySender().sendPacketsTill(replayTime); replayHandler.getReplaySender().sendPacketsTill(replayTime);
@@ -235,7 +235,7 @@ public class VideoRenderer implements RenderInfo {
// Updating the timer will cause the timeline player to update the game state // Updating the timer will cause the timeline player to update the game state
RenderTickCounter timer = ((MinecraftAccessor) mc).getTimer(); RenderTickCounter timer = ((MinecraftAccessor) mc).getTimer();
//#if MC>=11600 //#if MC>=11600
//$$ int elapsedTicks = int elapsedTicks =
//#endif //#endif
timer.beginRenderTick( timer.beginRenderTick(
//#if MC>=11400 //#if MC>=11400
@@ -243,7 +243,7 @@ public class VideoRenderer implements RenderInfo {
//#endif //#endif
); );
//#if MC<11600 //#if MC<11600
int elapsedTicks = timer.ticksThisFrame; //$$ int elapsedTicks = timer.ticksThisFrame;
//#endif //#endif
executeTaskQueue(); executeTaskQueue();
@@ -541,7 +541,7 @@ public class VideoRenderer implements RenderInfo {
mc.currentScreen = gui.toMinecraft(); mc.currentScreen = gui.toMinecraft();
mc.overlay.render( mc.overlay.render(
//#if MC>=11600 //#if MC>=11600
//$$ new MatrixStack(), new MatrixStack(),
//#endif //#endif
mouseX, mouseY, 0); mouseX, mouseY, 0);
} finally { } finally {
@@ -551,7 +551,7 @@ public class VideoRenderer implements RenderInfo {
gui.toMinecraft().tick(); gui.toMinecraft().tick();
gui.toMinecraft().render( gui.toMinecraft().render(
//#if MC>=11600 //#if MC>=11600
//$$ new MatrixStack(), new MatrixStack(),
//#endif //#endif
mouseX, mouseY, 0); mouseX, mouseY, 0);
} }

View File

@@ -27,8 +27,8 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.network.NetworkState; import net.minecraft.network.NetworkState;
import net.minecraft.network.Packet; import net.minecraft.network.Packet;
import net.minecraft.util.PacketByteBuf; import net.minecraft.network.PacketByteBuf;
import net.minecraft.network.packet.s2c.play.ChatMessageS2CPacket; import net.minecraft.network.packet.s2c.play.GameMessageS2CPacket;
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket; import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
import net.minecraft.network.packet.s2c.play.DisconnectS2CPacket; import net.minecraft.network.packet.s2c.play.DisconnectS2CPacket;
import net.minecraft.network.packet.s2c.play.EntitiesDestroyS2CPacket; import net.minecraft.network.packet.s2c.play.EntitiesDestroyS2CPacket;
@@ -37,10 +37,10 @@ import net.minecraft.network.packet.s2c.play.ExperienceBarUpdateS2CPacket;
import net.minecraft.network.packet.s2c.play.ExperienceOrbSpawnS2CPacket; import net.minecraft.network.packet.s2c.play.ExperienceOrbSpawnS2CPacket;
import net.minecraft.network.packet.s2c.play.GameJoinS2CPacket; import net.minecraft.network.packet.s2c.play.GameJoinS2CPacket;
import net.minecraft.network.packet.s2c.play.GameStateChangeS2CPacket; import net.minecraft.network.packet.s2c.play.GameStateChangeS2CPacket;
import net.minecraft.network.packet.s2c.play.CloseContainerS2CPacket; import net.minecraft.network.packet.s2c.play.CloseScreenS2CPacket;
import net.minecraft.network.packet.s2c.play.OpenHorseContainerS2CPacket; import net.minecraft.network.packet.s2c.play.OpenHorseScreenS2CPacket;
import net.minecraft.network.packet.s2c.play.ContainerSlotUpdateS2CPacket; import net.minecraft.network.packet.s2c.play.ScreenHandlerSlotUpdateS2CPacket;
import net.minecraft.network.packet.s2c.play.ContainerPropertyUpdateS2CPacket; import net.minecraft.network.packet.s2c.play.ScreenHandlerPropertyUpdateS2CPacket;
import net.minecraft.network.packet.s2c.play.HealthUpdateS2CPacket; import net.minecraft.network.packet.s2c.play.HealthUpdateS2CPacket;
import net.minecraft.network.packet.s2c.login.LoginSuccessS2CPacket; import net.minecraft.network.packet.s2c.login.LoginSuccessS2CPacket;
import net.minecraft.network.packet.s2c.play.MobSpawnS2CPacket; import net.minecraft.network.packet.s2c.play.MobSpawnS2CPacket;
@@ -66,14 +66,14 @@ import de.johni0702.minecraft.gui.versions.callbacks.PreTickCallback;
//#if MC>=11600 //#if MC>=11600
//#else //#else
import net.minecraft.network.packet.s2c.play.EntitySpawnGlobalS2CPacket; //$$ import net.minecraft.network.packet.s2c.play.EntitySpawnGlobalS2CPacket;
//#endif //#endif
//#if MC>=11400 //#if MC>=11400
import com.replaymod.core.versions.MCVer; import com.replaymod.core.versions.MCVer;
import net.minecraft.network.packet.s2c.play.ChunkDataS2CPacket; import net.minecraft.network.packet.s2c.play.ChunkDataS2CPacket;
import net.minecraft.network.packet.s2c.play.PlayerActionResponseS2CPacket; import net.minecraft.network.packet.s2c.play.PlayerActionResponseS2CPacket;
import net.minecraft.network.packet.s2c.play.OpenContainerS2CPacket; import net.minecraft.network.packet.s2c.play.OpenScreenS2CPacket;
import net.minecraft.network.packet.s2c.play.OpenWrittenBookS2CPacket; import net.minecraft.network.packet.s2c.play.OpenWrittenBookS2CPacket;
import net.minecraft.entity.EntityType; import net.minecraft.entity.EntityType;
import net.minecraft.text.TranslatableText; import net.minecraft.text.TranslatableText;
@@ -150,7 +150,7 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
//#endif //#endif
//#if MC>=11400 //#if MC>=11400
OpenWrittenBookS2CPacket.class, OpenWrittenBookS2CPacket.class,
OpenContainerS2CPacket.class, OpenScreenS2CPacket.class,
//#endif //#endif
//#if MC>=11200 //#if MC>=11200
SynchronizeRecipesS2CPacket.class, SynchronizeRecipesS2CPacket.class,
@@ -162,10 +162,10 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
TitleS2CPacket.class, TitleS2CPacket.class,
//#endif //#endif
HealthUpdateS2CPacket.class, HealthUpdateS2CPacket.class,
OpenHorseContainerS2CPacket.class, OpenHorseScreenS2CPacket.class,
CloseContainerS2CPacket.class, CloseScreenS2CPacket.class,
ContainerSlotUpdateS2CPacket.class, ScreenHandlerSlotUpdateS2CPacket.class,
ContainerPropertyUpdateS2CPacket.class, ScreenHandlerPropertyUpdateS2CPacket.class,
SignEditorOpenS2CPacket.class, SignEditorOpenS2CPacket.class,
StatisticsS2CPacket.class, StatisticsS2CPacket.class,
ExperienceBarUpdateS2CPacket.class, ExperienceBarUpdateS2CPacket.class,
@@ -427,7 +427,7 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|| p instanceof EntitySpawnS2CPacket || p instanceof EntitySpawnS2CPacket
|| p instanceof MobSpawnS2CPacket || p instanceof MobSpawnS2CPacket
//#if MC<11600 //#if MC<11600
|| p instanceof EntitySpawnGlobalS2CPacket //$$ || p instanceof EntitySpawnGlobalS2CPacket
//#endif //#endif
|| p instanceof PaintingSpawnS2CPacket || p instanceof PaintingSpawnS2CPacket
|| p instanceof ExperienceOrbSpawnS2CPacket || p instanceof ExperienceOrbSpawnS2CPacket
@@ -617,27 +617,27 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
entId, entId,
GameMode.SPECTATOR, GameMode.SPECTATOR,
//#if MC>=11600 //#if MC>=11600
//$$ GameMode.SPECTATOR, GameMode.SPECTATOR,
//#endif //#endif
//#if MC>=11500 //#if MC>=11500
packet.getSeed(), packet.getSha256Seed(),
//#endif //#endif
false, false,
//#if MC>=11600 //#if MC>=11600
//$$ packet.method_29443(), packet.method_29443(),
//#if MC>=11602 //#if MC>=11602
//$$ (net.minecraft.util.registry.DynamicRegistryManager.Impl) packet.getRegistryManager(), (net.minecraft.util.registry.DynamicRegistryManager.Impl) packet.getRegistryManager(),
//#else //#else
//$$ (net.minecraft.util.registry.RegistryTracker.Modifiable) packet.getDimension(), //$$ (net.minecraft.util.registry.RegistryTracker.Modifiable) packet.getDimension(),
//#endif //#endif
//$$ packet.method_29444(), packet.method_29444(),
//$$ packet.getDimensionId(), packet.getDimensionId(),
//#else //#else
packet.getDimension(), //$$ packet.getDimension(),
//#endif //#endif
0, // max players (has no getter -> never actually used) 0, // max players (has no getter -> never actually used)
//#if MC<11600 //#if MC<11600
packet.getGeneratorType(), //$$ packet.getGeneratorType(),
//#endif //#endif
packet.getChunkLoadDistance(), packet.getChunkLoadDistance(),
packet.hasReducedDebugInfo() packet.hasReducedDebugInfo()
@@ -645,8 +645,8 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
, packet.showsDeathScreen() , packet.showsDeathScreen()
//#endif //#endif
//#if MC>=11600 //#if MC>=11600
//$$ , packet.isDebugWorld() , packet.isDebugWorld()
//$$ , packet.isFlatWorld() , packet.isFlatWorld()
//#endif //#endif
); );
//#else //#else
@@ -688,21 +688,21 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
//#if MC>=11400 //#if MC>=11400
p = new PlayerRespawnS2CPacket( p = new PlayerRespawnS2CPacket(
//#if MC>=11600 //#if MC>=11600
//$$ respawn.method_29445(), respawn.method_29445(),
//#endif //#endif
respawn.getDimension(), respawn.getDimension(),
//#if MC>=11500 //#if MC>=11500
respawn.getSha256Seed(), respawn.getSha256Seed(),
//#endif //#endif
//#if MC>=11600 //#if MC>=11600
//$$ GameMode.SPECTATOR, GameMode.SPECTATOR,
//$$ GameMode.SPECTATOR, GameMode.SPECTATOR,
//$$ respawn.isDebugWorld(), respawn.isDebugWorld(),
//$$ respawn.isFlatWorld(), respawn.isFlatWorld(),
//$$ respawn.isWritingErrorSkippable() respawn.isWritingErrorSkippable()
//#else //#else
respawn.getGeneratorType(), //$$ respawn.getGeneratorType(),
GameMode.SPECTATOR //$$ GameMode.SPECTATOR
//#endif //#endif
); );
//#else //#else
@@ -792,22 +792,22 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
// 8 - Fade time // 8 - Fade time
if (!Arrays.asList( if (!Arrays.asList(
//#if MC>=11600 //#if MC>=11600
//$$ GameStateChangeS2CPacket.RAIN_STARTED, GameStateChangeS2CPacket.RAIN_STARTED,
//$$ GameStateChangeS2CPacket.RAIN_STOPPED, GameStateChangeS2CPacket.RAIN_STOPPED,
//$$ GameStateChangeS2CPacket.RAIN_GRADIENT_CHANGED, GameStateChangeS2CPacket.RAIN_GRADIENT_CHANGED,
//$$ GameStateChangeS2CPacket.THUNDER_GRADIENT_CHANGED GameStateChangeS2CPacket.THUNDER_GRADIENT_CHANGED
//#else //#else
1, //$$ 1,
2, //$$ 2,
7, //$$ 7,
8 //$$ 8
//#endif //#endif
).contains(pg.getReason())) { ).contains(pg.getReason())) {
return null; return null;
} }
} }
if (p instanceof ChatMessageS2CPacket) { if (p instanceof GameMessageS2CPacket) {
if (!ReplayModReplay.instance.getCore().getSettingsRegistry().get(Setting.SHOW_CHAT)) { if (!ReplayModReplay.instance.getCore().getSettingsRegistry().get(Setting.SHOW_CHAT)) {
return null; return null;
} }

View File

@@ -47,9 +47,9 @@ public class InputReplayTimer extends WrappedTimer {
@Override @Override
public public
//#if MC>=11600 //#if MC>=11600
//$$ int int
//#else //#else
void //$$ void
//#endif //#endif
beginRenderTick( beginRenderTick(
//#if MC>=11400 //#if MC>=11400
@@ -57,7 +57,7 @@ public class InputReplayTimer extends WrappedTimer {
//#endif //#endif
) { ) {
//#if MC>=11600 //#if MC>=11600
//$$ int ticksThisFrame = int ticksThisFrame =
//#endif //#endif
super.beginRenderTick( super.beginRenderTick(
//#if MC>=11400 //#if MC>=11400
@@ -124,7 +124,7 @@ public class InputReplayTimer extends WrappedTimer {
//#endif //#endif
} }
//#if MC>=11600 //#if MC>=11600
//$$ return ticksThisFrame; return ticksThisFrame;
//#endif //#endif
} }

View File

@@ -23,7 +23,7 @@ import net.minecraft.network.packet.s2c.play.PlayerRespawnS2CPacket;
import net.minecraft.network.NetworkState; import net.minecraft.network.NetworkState;
import net.minecraft.network.NetworkSide; import net.minecraft.network.NetworkSide;
import net.minecraft.network.Packet; import net.minecraft.network.Packet;
import net.minecraft.util.PacketByteBuf; import net.minecraft.network.PacketByteBuf;
//#if FABRIC>=1 //#if FABRIC>=1
import de.johni0702.minecraft.gui.versions.callbacks.PreTickCallback; import de.johni0702.minecraft.gui.versions.callbacks.PreTickCallback;
@@ -40,14 +40,14 @@ import java.util.Collections;
import java.util.function.Consumer; import java.util.function.Consumer;
//#if MC>=11602 //#if MC>=11602
//$$ import net.minecraft.util.registry.DynamicRegistryManager; import net.minecraft.util.registry.DynamicRegistryManager;
//$$ import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
//#endif //#endif
//#if MC>=11600 //#if MC>=11600
//$$ import net.minecraft.world.World; import net.minecraft.world.World;
//#else //#else
import net.minecraft.world.level.LevelGeneratorType; //$$ import net.minecraft.world.level.LevelGeneratorType;
//#endif //#endif
//#if MC>=11400 //#if MC>=11400
import net.minecraft.world.dimension.DimensionType; import net.minecraft.world.dimension.DimensionType;
@@ -201,31 +201,31 @@ public class QuickReplaySender extends ChannelHandlerAdapter implements ReplaySe
ctx.fireChannelRead(new PlayerRespawnS2CPacket( ctx.fireChannelRead(new PlayerRespawnS2CPacket(
//#if MC>=11600 //#if MC>=11600
//#if MC>=11602 //#if MC>=11602
//$$ DimensionType.addRegistryDefaults(new DynamicRegistryManager.Impl()).get(Registry.DIMENSION_TYPE_KEY).get(DimensionType.OVERWORLD_REGISTRY_KEY), DimensionType.addRegistryDefaults(new DynamicRegistryManager.Impl()).get(Registry.DIMENSION_TYPE_KEY).get(DimensionType.OVERWORLD_REGISTRY_KEY),
//#else //#else
//$$ DimensionType.OVERWORLD_REGISTRY_KEY, //$$ DimensionType.OVERWORLD_REGISTRY_KEY,
//#endif //#endif
//$$ World.OVERWORLD, World.OVERWORLD,
//$$ 0, 0,
//$$ GameMode.SPECTATOR, GameMode.SPECTATOR,
//$$ GameMode.SPECTATOR, GameMode.SPECTATOR,
//$$ false, false,
//$$ false, false,
//$$ false false
//#else //#else
//#if MC>=11400 //#if MC>=11400
DimensionType.OVERWORLD, //$$ DimensionType.OVERWORLD,
//#else //#else
//$$ 0, //$$ 0,
//#endif //#endif
//#if MC>=11500 //#if MC>=11500
0, //$$ 0,
//#endif //#endif
//#if MC<11400 //#if MC<11400
//$$ EnumDifficulty.NORMAL, //$$ EnumDifficulty.NORMAL,
//#endif //#endif
LevelGeneratorType.DEFAULT, //$$ LevelGeneratorType.DEFAULT,
GameMode.SPECTATOR //$$ GameMode.SPECTATOR
//#endif //#endif
)); ));
ctx.fireChannelRead(new PlayerPositionLookS2CPacket(0, 0, 0, 0, 0, Collections.emptySet(), 0)); ctx.fireChannelRead(new PlayerPositionLookS2CPacket(0, 0, 0, 0, 0, Collections.emptySet(), 0));

View File

@@ -39,7 +39,7 @@ import java.io.IOException;
import java.util.*; import java.util.*;
//#if MC>=11600 //#if MC>=11600
//$$ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;
//#endif //#endif
//#if MC>=11500 //#if MC>=11500
@@ -644,10 +644,10 @@ public class ReplayHandler {
resolution = newScaledResolution(mc); resolution = newScaledResolution(mc);
guiScreen.toMinecraft().init(mc, resolution.getScaledWidth(), resolution.getScaledHeight()); guiScreen.toMinecraft().init(mc, resolution.getScaledWidth(), resolution.getScaledHeight());
//#if MC>=11600 //#if MC>=11600
//$$ guiScreen.toMinecraft().render(new MatrixStack(), 0, 0, 0); guiScreen.toMinecraft().render(new MatrixStack(), 0, 0, 0);
//#else //#else
//#if MC>=11400 //#if MC>=11400
guiScreen.toMinecraft().render(0, 0, 0); //$$ guiScreen.toMinecraft().render(0, 0, 0);
//#else //#else
//$$ guiScreen.toMinecraft().drawScreen(0, 0, 0); //$$ guiScreen.toMinecraft().drawScreen(0, 0, 0);
//#endif //#endif

View File

@@ -64,7 +64,7 @@ import net.minecraft.util.hit.HitResult;
import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.EquipmentSlot;
//#if MC>=11200 //#if MC>=11200
//#if MC>=11400 //#if MC>=11400
import net.minecraft.client.recipe.book.ClientRecipeBook; import net.minecraft.client.recipebook.ClientRecipeBook;
//#else //#else
//$$ import net.minecraft.stats.RecipeBook; //$$ import net.minecraft.stats.RecipeBook;
//#endif //#endif
@@ -150,8 +150,8 @@ public class CameraEntity
, recipeBook , recipeBook
//#endif //#endif
//#if MC>=11600 //#if MC>=11600
//$$ , false , false
//$$ , false , false
//#endif //#endif
); );
eventHandler.register(); eventHandler.register();
@@ -321,8 +321,8 @@ public class CameraEntity
//#if MC>=11400 //#if MC>=11400
@Override @Override
public boolean isInFluid(Tag<Fluid> fluid) { public boolean isSubmergedIn(Tag<Fluid> fluid) {
return falseUnlessSpectating(entity -> entity.isInFluid(fluid)); return falseUnlessSpectating(entity -> entity.isSubmergedIn(fluid));
} }
//#else //#else
//#if MC>=10800 //#if MC>=10800

View File

@@ -34,32 +34,32 @@ public class ClassicCameraController implements CameraController {
speedup = false; speedup = false;
for(KeyBinding kb : getMinecraft().options.keysAll) { for(KeyBinding kb : getMinecraft().options.keysAll) {
if(!kb.isPressed()) continue; if(!kb.isPressed()) continue;
if(kb.getId().equals("key.forward")) { if(kb.getTranslationKey().equals("key.forward")) {
forward = true; forward = true;
speedup = true; speedup = true;
} }
if(kb.getId().equals("key.back")) { if(kb.getTranslationKey().equals("key.back")) {
backward = true; backward = true;
speedup = true; speedup = true;
} }
if(kb.getId().equals("key.jump")) { if(kb.getTranslationKey().equals("key.jump")) {
up = true; up = true;
speedup = true; speedup = true;
} }
if(kb.getId().equals("key.left")) { if(kb.getTranslationKey().equals("key.left")) {
left = true; left = true;
speedup = true; speedup = true;
} }
if(kb.getId().equals("key.right")) { if(kb.getTranslationKey().equals("key.right")) {
right = true; right = true;
speedup = true; speedup = true;
} }
if(kb.getId().equals("key.sneak")) { if(kb.getTranslationKey().equals("key.sneak")) {
down = true; down = true;
speedup = true; speedup = true;
} }

View File

@@ -11,8 +11,8 @@ import net.minecraft.client.gui.widget.AbstractButtonWidget;
import net.minecraft.client.resource.language.I18n; import net.minecraft.client.resource.language.I18n;
//#if MC>=11600 //#if MC>=11600
//$$ import net.minecraft.text.Text; import net.minecraft.text.Text;
//$$ import net.minecraft.text.TranslatableText; import net.minecraft.text.TranslatableText;
//#endif //#endif
//#if FABRIC>=1 //#if FABRIC>=1
@@ -62,18 +62,18 @@ public class GuiHandler extends EventRegistrations {
mod.getReplayHandler().getReplaySender().setReplaySpeed(0); mod.getReplayHandler().getReplaySender().setReplaySpeed(0);
//#if MC>=11600 //#if MC>=11600
//$$ final TranslatableText BUTTON_OPTIONS = new TranslatableText("menu.options"); final TranslatableText BUTTON_OPTIONS = new TranslatableText("menu.options");
//$$ final TranslatableText BUTTON_EXIT_SERVER = new TranslatableText("menu.disconnect"); final TranslatableText BUTTON_EXIT_SERVER = new TranslatableText("menu.disconnect");
//$$ final TranslatableText BUTTON_ADVANCEMENTS = new TranslatableText("gui.advancements"); final TranslatableText BUTTON_ADVANCEMENTS = new TranslatableText("gui.advancements");
//$$ final TranslatableText BUTTON_STATS = new TranslatableText("gui.stats"); final TranslatableText BUTTON_STATS = new TranslatableText("gui.stats");
//$$ final TranslatableText BUTTON_OPEN_TO_LAN = new TranslatableText("menu.shareToLan"); final TranslatableText BUTTON_OPEN_TO_LAN = new TranslatableText("menu.shareToLan");
//#else //#else
//#if MC>=11400 //#if MC>=11400
final String BUTTON_OPTIONS = I18n.translate("menu.options"); //$$ final String BUTTON_OPTIONS = I18n.translate("menu.options");
final String BUTTON_EXIT_SERVER = I18n.translate("menu.disconnect"); //$$ final String BUTTON_EXIT_SERVER = I18n.translate("menu.disconnect");
final String BUTTON_ADVANCEMENTS = I18n.translate("gui.advancements"); //$$ final String BUTTON_ADVANCEMENTS = I18n.translate("gui.advancements");
final String BUTTON_STATS = I18n.translate("gui.stats"); //$$ final String BUTTON_STATS = I18n.translate("gui.stats");
final String BUTTON_OPEN_TO_LAN = I18n.translate("menu.shareToLan"); //$$ final String BUTTON_OPEN_TO_LAN = I18n.translate("menu.shareToLan");
//#else //#else
//#if MC>=11400 //#if MC>=11400
//$$ final int BUTTON_OPTIONS = 0; //$$ final int BUTTON_OPTIONS = 0;
@@ -99,9 +99,9 @@ public class GuiHandler extends EventRegistrations {
boolean remove = false; boolean remove = false;
//#if MC>=11400 //#if MC>=11400
//#if MC>=11600 //#if MC>=11600
//$$ Text id = b.getMessage(); Text id = b.getMessage();
//#else //#else
String id = b.getMessage(); //$$ String id = b.getMessage();
//#endif //#endif
if (id == null) { if (id == null) {
// likely a button of some third-part mod // likely a button of some third-part mod
@@ -301,9 +301,9 @@ public class GuiHandler extends EventRegistrations {
width, width,
height, height,
//#if MC>=11600 //#if MC>=11600
//$$ new TranslatableText(buttonText) new TranslatableText(buttonText)
//#else //#else
I18n.translate(buttonText) //$$ I18n.translate(buttonText)
//#endif //#endif
//#if MC>=11400 //#if MC>=11400
, self -> onClick.accept((InjectedButton) self) , self -> onClick.accept((InjectedButton) self)

View File

@@ -10,9 +10,9 @@ import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
//#if MC>=11600 //#if MC>=11600
//$$ import net.minecraft.client.world.ClientWorld; import net.minecraft.client.world.ClientWorld;
//#else //#else
import net.minecraft.world.World; //$$ import net.minecraft.world.World;
//#endif //#endif
import java.util.Queue; import java.util.Queue;
@@ -37,9 +37,9 @@ public abstract class MixinParticleManager {
@Inject(method = "setWorld", at = @At("HEAD")) @Inject(method = "setWorld", at = @At("HEAD"))
public void replayModReplay_clearParticleQueue( public void replayModReplay_clearParticleQueue(
//#if MC>=11600 //#if MC>=11600
//$$ ClientWorld world, ClientWorld world,
//#else //#else
World world, //$$ World world,
//#endif //#endif
CallbackInfo ci) { CallbackInfo ci) {
//#if MC>=11400 //#if MC>=11400

View File

@@ -19,7 +19,7 @@ import net.minecraft.client.world.ClientWorld;
//#if MC>=11200 //#if MC>=11200
//#if MC>=11400 //#if MC>=11400
import net.minecraft.client.recipe.book.ClientRecipeBook; import net.minecraft.client.recipebook.ClientRecipeBook;
//#else //#else
//$$ import net.minecraft.stats.RecipeBook; //$$ import net.minecraft.stats.RecipeBook;
//#endif //#endif
@@ -52,9 +52,9 @@ public abstract class MixinPlayerControllerMP {
//#if MC>=11400 //#if MC>=11400
//#if MC>=11602 //#if MC>=11602
//$$ @Inject(method = "createPlayer(Lnet/minecraft/client/world/ClientWorld;Lnet/minecraft/stat/StatHandler;Lnet/minecraft/client/recipebook/ClientRecipeBook;ZZ)Lnet/minecraft/client/network/ClientPlayerEntity;", at=@At("HEAD"), cancellable = true) @Inject(method = "createPlayer(Lnet/minecraft/client/world/ClientWorld;Lnet/minecraft/stat/StatHandler;Lnet/minecraft/client/recipebook/ClientRecipeBook;ZZ)Lnet/minecraft/client/network/ClientPlayerEntity;", at=@At("HEAD"), cancellable = true)
//#else //#else
@Inject(method = "createPlayer", at=@At("HEAD"), cancellable = true) //$$ @Inject(method = "createPlayer", at=@At("HEAD"), cancellable = true)
//#endif //#endif
private void replayModReplay_createReplayCamera( private void replayModReplay_createReplayCamera(
//#if MC>=11400 //#if MC>=11400
@@ -65,8 +65,8 @@ public abstract class MixinPlayerControllerMP {
StatHandler statisticsManager, StatHandler statisticsManager,
ClientRecipeBook recipeBookClient, ClientRecipeBook recipeBookClient,
//#if MC>=11600 //#if MC>=11600
//$$ boolean lastIsHoldingSneakKey, boolean lastIsHoldingSneakKey,
//$$ boolean lastSprinting, boolean lastSprinting,
//#endif //#endif
CallbackInfoReturnable<ClientPlayerEntity> ci CallbackInfoReturnable<ClientPlayerEntity> ci
) { ) {

View File

@@ -1 +1 @@
1.15.2 1.16.2