./gradlew :1.16.2:setCoreVersion
This commit is contained in:
@@ -8,8 +8,8 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
//#if MC>=11600
|
||||
//$$ import net.minecraft.client.render.Camera;
|
||||
//$$ import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.render.Camera;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11400
|
||||
@@ -30,12 +30,12 @@ public abstract class MixinShadersRender {
|
||||
private static void replayModCompat_disableRenderHand0(
|
||||
GameRenderer er,
|
||||
//#if MC>=11600
|
||||
//$$ MatrixStack stack,
|
||||
//$$ Camera camera,
|
||||
MatrixStack stack,
|
||||
Camera camera,
|
||||
//#endif
|
||||
float partialTicks,
|
||||
//#if MC<11600
|
||||
int renderPass,
|
||||
//$$ int renderPass,
|
||||
//#endif
|
||||
CallbackInfo ci) {
|
||||
//#if MC>=11400
|
||||
|
||||
@@ -657,13 +657,13 @@ public class ReplayMod implements
|
||||
// Some nostalgia: "§8[§6Replay Mod§8]§r Your message goes here"
|
||||
//#if MC>=10904
|
||||
//#if MC>=11600
|
||||
//$$ Style coloredDarkGray = Style.EMPTY.withColor(Formatting.DARK_GRAY);
|
||||
//$$ Style coloredGold = Style.EMPTY.withColor(Formatting.GOLD);
|
||||
//$$ Style alert = Style.EMPTY.withColor(warning ? Formatting.RED : Formatting.DARK_GREEN);
|
||||
Style coloredDarkGray = Style.EMPTY.withColor(Formatting.DARK_GRAY);
|
||||
Style coloredGold = Style.EMPTY.withColor(Formatting.GOLD);
|
||||
Style alert = Style.EMPTY.withColor(warning ? Formatting.RED : Formatting.DARK_GREEN);
|
||||
//#else
|
||||
Style coloredDarkGray = new Style().setColor(Formatting.DARK_GRAY);
|
||||
Style coloredGold = new Style().setColor(Formatting.GOLD);
|
||||
Style alert = new Style().setColor(warning ? Formatting.RED : Formatting.DARK_GREEN);
|
||||
//$$ Style coloredDarkGray = new Style().setColor(Formatting.DARK_GRAY);
|
||||
//$$ Style coloredGold = new Style().setColor(Formatting.GOLD);
|
||||
//$$ Style alert = new Style().setColor(warning ? Formatting.RED : Formatting.DARK_GREEN);
|
||||
//#endif
|
||||
Text text = new LiteralText("[").setStyle(coloredDarkGray)
|
||||
.append(new TranslatableText("replaymod.title").setStyle(coloredGold))
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
import static com.replaymod.core.versions.MCVer.*;
|
||||
|
||||
//#if MC>=11400 && MC<11600
|
||||
import net.minecraft.realms.RealmsScreenProxy;
|
||||
//$$ import net.minecraft.realms.RealmsScreenProxy;
|
||||
//#endif
|
||||
|
||||
//#if FABRIC>=1
|
||||
@@ -72,53 +72,53 @@ public class MainMenuHandler extends EventRegistrations {
|
||||
//#endif
|
||||
}
|
||||
//#if MC>=11400 && MC<11600
|
||||
GuiMainMenuAccessor guiA = (GuiMainMenuAccessor) gui;
|
||||
if (realmsOffset != 0 && guiA.getRealmsNotification() instanceof RealmsScreenProxy) {
|
||||
guiA.setRealmsNotification(new RealmsNotificationProxy((RealmsScreenProxy) guiA.getRealmsNotification(), realmsOffset));
|
||||
}
|
||||
//$$ GuiMainMenuAccessor guiA = (GuiMainMenuAccessor) gui;
|
||||
//$$ if (realmsOffset != 0 && guiA.getRealmsNotification() instanceof RealmsScreenProxy) {
|
||||
//$$ guiA.setRealmsNotification(new RealmsNotificationProxy((RealmsScreenProxy) guiA.getRealmsNotification(), realmsOffset));
|
||||
//$$ }
|
||||
//#endif
|
||||
}
|
||||
}
|
||||
|
||||
//#if MC>=11400 && MC<11600
|
||||
private static class RealmsNotificationProxy extends Screen {
|
||||
private final RealmsScreenProxy proxy;
|
||||
private final int offset;
|
||||
|
||||
private RealmsNotificationProxy(RealmsScreenProxy proxy, int offset) {
|
||||
//$$ private static class RealmsNotificationProxy extends Screen {
|
||||
//$$ private final RealmsScreenProxy proxy;
|
||||
//$$ private final int offset;
|
||||
//$$
|
||||
//$$ private RealmsNotificationProxy(RealmsScreenProxy proxy, int offset) {
|
||||
//#if MC>=11400
|
||||
super(null);
|
||||
//$$ super(null);
|
||||
//#endif
|
||||
this.proxy = proxy;
|
||||
this.offset = offset;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(MinecraftClient mc, int width, int height) {
|
||||
proxy.init(mc, width, height);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
proxy.tick();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(int mouseX, int mouseY, float partialTicks) {
|
||||
GL11.glTranslated(0, offset, 0);
|
||||
proxy.render(mouseX, mouseY - offset, partialTicks);
|
||||
GL11.glTranslated(0, -offset, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) {
|
||||
return proxy.mouseClicked(mouseX, mouseY - offset, mouseButton);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removed() {
|
||||
proxy.removed();
|
||||
}
|
||||
}
|
||||
//$$ this.proxy = proxy;
|
||||
//$$ this.offset = offset;
|
||||
//$$ }
|
||||
//$$
|
||||
//$$ @Override
|
||||
//$$ public void init(MinecraftClient mc, int width, int height) {
|
||||
//$$ proxy.init(mc, width, height);
|
||||
//$$ }
|
||||
//$$
|
||||
//$$ @Override
|
||||
//$$ public void tick() {
|
||||
//$$ proxy.tick();
|
||||
//$$ }
|
||||
//$$
|
||||
//$$ @Override
|
||||
//$$ public void render(int mouseX, int mouseY, float partialTicks) {
|
||||
//$$ GL11.glTranslated(0, offset, 0);
|
||||
//$$ proxy.render(mouseX, mouseY - offset, partialTicks);
|
||||
//$$ GL11.glTranslated(0, -offset, 0);
|
||||
//$$ }
|
||||
//$$
|
||||
//$$ @Override
|
||||
//$$ public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) {
|
||||
//$$ return proxy.mouseClicked(mouseX, mouseY - offset, mouseButton);
|
||||
//$$ }
|
||||
//$$
|
||||
//$$ @Override
|
||||
//$$ public void removed() {
|
||||
//$$ proxy.removed();
|
||||
//$$ }
|
||||
//$$ }
|
||||
//#endif
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(Keyboard.class)
|
||||
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) {
|
||||
KeyBindingEventCallback.EVENT.invoker().onKeybindingEvent();
|
||||
KeyEventCallback.EVENT.invoker().onKeyEvent(key, scanCode, action, modifiers);
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(Mouse.class)
|
||||
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) {
|
||||
KeyBindingEventCallback.EVENT.invoker().onKeybindingEvent();
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class Mixin_ContextualKeyBindings {
|
||||
} else {
|
||||
// Not in a replay, remove all replay-exclusive keybindings
|
||||
for (KeyBinding keyBinding : onlyInReplay) {
|
||||
if (Mixin_ContextualKeyBindings.keysById.remove(keyBinding.getId()) != null) {
|
||||
if (Mixin_ContextualKeyBindings.keysById.remove(keyBinding.getTranslationKey()) != null) {
|
||||
temporarilyRemoved.add(keyBinding);
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ public class Mixin_ContextualKeyBindings {
|
||||
@Inject(method = "updateKeysByCode", at = @At("RETURN"))
|
||||
private static void postContextualKeyBindings(CallbackInfo ci) {
|
||||
for (KeyBinding keyBinding : temporarilyRemoved) {
|
||||
Mixin_ContextualKeyBindings.keysById.put(keyBinding.getId(), keyBinding);
|
||||
Mixin_ContextualKeyBindings.keysById.put(keyBinding.getTranslationKey(), keyBinding);
|
||||
}
|
||||
temporarilyRemoved.clear();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.replaymod.core.utils;
|
||||
|
||||
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
|
||||
import net.minecraft.util.PacketByteBuf;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
//#if MC>=10904
|
||||
import net.minecraft.util.Identifier;
|
||||
//#endif
|
||||
|
||||
@@ -21,9 +21,9 @@ public class WrappedTimer extends RenderTickCounter {
|
||||
@Override
|
||||
public
|
||||
//#if MC>=11600
|
||||
//$$ int
|
||||
int
|
||||
//#else
|
||||
void
|
||||
//$$ void
|
||||
//#endif
|
||||
beginRenderTick(
|
||||
//#if MC>=11400
|
||||
@@ -33,7 +33,7 @@ public class WrappedTimer extends RenderTickCounter {
|
||||
copy(this, wrapped);
|
||||
try {
|
||||
//#if MC>=11600
|
||||
//$$ return
|
||||
return
|
||||
//#endif
|
||||
wrapped.beginRenderTick(
|
||||
//#if MC>=11400
|
||||
@@ -50,7 +50,7 @@ public class WrappedTimer extends RenderTickCounter {
|
||||
TimerAccessor toA = (TimerAccessor) to;
|
||||
|
||||
//#if MC<11600
|
||||
to.ticksThisFrame = from.ticksThisFrame;
|
||||
//$$ to.ticksThisFrame = from.ticksThisFrame;
|
||||
//#endif
|
||||
to.tickDelta = from.tickDelta;
|
||||
toA.setLastSyncSysClock(fromA.getLastSyncSysClock());
|
||||
|
||||
@@ -14,7 +14,7 @@ import net.minecraft.client.model.ModelPart;
|
||||
import net.minecraft.util.crash.CrashReportSection;
|
||||
import net.minecraft.entity.Entity;
|
||||
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.Util;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
@@ -24,7 +24,7 @@ import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
//#if MC>=11600
|
||||
//$$ import net.minecraft.resource.ResourcePackSource;
|
||||
import net.minecraft.resource.ResourcePackSource;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11500
|
||||
@@ -44,9 +44,9 @@ import net.minecraft.client.gui.widget.AbstractButtonWidget;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
//#if MC>=11600
|
||||
//$$ import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
//#else
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
//$$ import net.minecraft.client.resource.language.I18n;
|
||||
//#endif
|
||||
//#else
|
||||
//$$ import com.google.common.util.concurrent.FutureCallback;
|
||||
@@ -448,7 +448,7 @@ public class MCVer {
|
||||
return getMinecraft().getResourcePackDownloader().loadServerPack(
|
||||
file
|
||||
//#if MC>=11600
|
||||
//$$ , ResourcePackSource.PACK_SOURCE_SERVER
|
||||
, ResourcePackSource.PACK_SOURCE_SERVER
|
||||
//#endif
|
||||
);
|
||||
//#else
|
||||
@@ -574,7 +574,7 @@ public class MCVer {
|
||||
|
||||
public static EntityRenderDispatcher getRenderManager() {
|
||||
//#if MC>=10800
|
||||
return getMinecraft().getEntityRenderManager();
|
||||
return getMinecraft().getEntityRenderDispatcher();
|
||||
//#else
|
||||
//$$ return RenderManager.instance;
|
||||
//#endif
|
||||
@@ -613,9 +613,9 @@ public class MCVer {
|
||||
//#if MC>=11400
|
||||
public static Optional<AbstractButtonWidget> findButton(List<AbstractButtonWidget> buttonList, @SuppressWarnings("unused") String text, @SuppressWarnings("unused") int id) {
|
||||
//#if MC>=11600
|
||||
//$$ final TranslatableText message = new TranslatableText(text);
|
||||
final TranslatableText message = new TranslatableText(text);
|
||||
//#else
|
||||
final String message = I18n.translate(text);
|
||||
//$$ final String message = I18n.translate(text);
|
||||
//#endif
|
||||
for (AbstractButtonWidget b : buttonList) {
|
||||
if (message.equals(b.getMessage())) {
|
||||
|
||||
@@ -74,7 +74,7 @@ public class HotkeyButtons extends EventRegistrations implements Extra {
|
||||
|
||||
final KeyBindingRegistry keyBindingRegistry = mod.getKeyBindingRegistry();
|
||||
keyBindingRegistry.getKeyBindings().values().stream()
|
||||
.sorted(Comparator.comparing(it -> I18n.translate(it.getId())))
|
||||
.sorted(Comparator.comparing(it -> I18n.translate(it.getTranslationKey())))
|
||||
.forEachOrdered(keyBinding -> {
|
||||
GuiButton button = new GuiButton(){
|
||||
@Override
|
||||
@@ -83,10 +83,10 @@ public class HotkeyButtons extends EventRegistrations implements Extra {
|
||||
String keyName = "???";
|
||||
try {
|
||||
//#if MC>=11600
|
||||
//$$ keyName = keyBinding.getBoundKeyLocalizedText().asString();
|
||||
keyName = keyBinding.getBoundKeyLocalizedText().asString();
|
||||
//#else
|
||||
//#if MC>=11400
|
||||
keyName = keyBinding.getLocalizedName();
|
||||
//$$ keyName = keyBinding.getLocalizedName();
|
||||
//#else
|
||||
//$$ keyName = Keyboard.getKeyName(keyBinding.getKeyCode());
|
||||
//#endif
|
||||
@@ -115,7 +115,7 @@ public class HotkeyButtons extends EventRegistrations implements Extra {
|
||||
return new Dimension(Math.max(10, button.getMinSize().getWidth()) + 10, 20);
|
||||
}
|
||||
}).addElements(null, button),
|
||||
new GuiLabel().setI18nText(keyBinding.getId())
|
||||
new GuiLabel().setI18nText(keyBinding.getTranslationKey())
|
||||
));
|
||||
});
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public class ReplayTimer extends WrappedTimer {
|
||||
//#endif
|
||||
|
||||
//#if MC>=11600
|
||||
//$$ public int ticksThisFrame;
|
||||
public int ticksThisFrame;
|
||||
//#endif
|
||||
|
||||
public ReplayTimer(RenderTickCounter wrapped) {
|
||||
@@ -27,9 +27,9 @@ public class ReplayTimer extends WrappedTimer {
|
||||
//#if MC>=11400
|
||||
public
|
||||
//#if MC>=11600
|
||||
//$$ int
|
||||
int
|
||||
//#else
|
||||
void
|
||||
//$$ void
|
||||
//#endif
|
||||
beginRenderTick(
|
||||
//#else
|
||||
@@ -42,7 +42,7 @@ public class ReplayTimer extends WrappedTimer {
|
||||
copy(this, state); // Save our current state
|
||||
try {
|
||||
//#if MC>=11600
|
||||
//$$ ticksThisFrame =
|
||||
ticksThisFrame =
|
||||
//#endif
|
||||
wrapped.beginRenderTick(
|
||||
//#if MC>=11400
|
||||
@@ -54,7 +54,7 @@ public class ReplayTimer extends WrappedTimer {
|
||||
UpdatedCallback.EVENT.invoker().onUpdate();
|
||||
}
|
||||
//#if MC>=11600
|
||||
//$$ return ticksThisFrame;
|
||||
return ticksThisFrame;
|
||||
//#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public class GuiRecordingOverlay extends EventRegistrations {
|
||||
String text = guiControls.isPaused() ? I18n.translate("replaymod.gui.paused") : I18n.translate("replaymod.gui.recording");
|
||||
fontRenderer.draw(
|
||||
//#if MC>=11600
|
||||
//$$ stack,
|
||||
stack,
|
||||
//#endif
|
||||
text.toUpperCase(), 30, 18 - (fontRenderer.fontHeight / 2), 0xffffffff);
|
||||
bindTexture(TEXTURE);
|
||||
|
||||
@@ -19,14 +19,14 @@ import net.minecraft.network.ClientConnection;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
//#if MC>=11600
|
||||
//$$ import net.minecraft.world.World;
|
||||
import net.minecraft.world.World;
|
||||
//#else
|
||||
//#if MC>=11400
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
//$$ import net.minecraft.world.dimension.DimensionType;
|
||||
//#endif
|
||||
|
||||
//$$
|
||||
//#if MC>=10800
|
||||
import net.minecraft.world.level.LevelGeneratorType;
|
||||
//$$ import net.minecraft.world.level.LevelGeneratorType;
|
||||
//#endif
|
||||
//#endif
|
||||
|
||||
@@ -65,10 +65,10 @@ public class ConnectionEventHandler {
|
||||
if (local) {
|
||||
//#if MC>=10800
|
||||
//#if MC>=11600
|
||||
//$$ if (mc.getServer().getWorld(World.OVERWORLD).isDebugWorld()) {
|
||||
if (mc.getServer().getWorld(World.OVERWORLD).isDebugWorld()) {
|
||||
//#else
|
||||
//#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
|
||||
//$$ if (mc.getIntegratedServer().getEntityWorld().getWorldType() == WorldType.DEBUG_ALL_BLOCK_STATES) {
|
||||
//#endif
|
||||
@@ -91,9 +91,9 @@ public class ConnectionEventHandler {
|
||||
String worldName;
|
||||
if (local) {
|
||||
//#if MC>=11600
|
||||
//$$ worldName = mc.getServer().getSaveProperties().getLevelName();
|
||||
worldName = mc.getServer().getSaveProperties().getLevelName();
|
||||
//#else
|
||||
worldName = mc.getServer().getLevelName();
|
||||
//$$ worldName = mc.getServer().getLevelName();
|
||||
//#endif
|
||||
} else if (mc.getCurrentServerEntry() != null) {
|
||||
worldName = mc.getCurrentServerEntry().address;
|
||||
|
||||
@@ -32,8 +32,8 @@ import de.johni0702.minecraft.gui.versions.callbacks.PreTickCallback;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11600
|
||||
//$$ import com.mojang.datafixers.util.Pair;
|
||||
//$$ import java.util.Collections;
|
||||
import com.mojang.datafixers.util.Pair;
|
||||
import java.util.Collections;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11400
|
||||
@@ -210,10 +210,10 @@ public class RecordingEventHandler extends EventRegistrations {
|
||||
//#endif
|
||||
newYaw, newPitch
|
||||
//#if MC>=11600
|
||||
//$$ , player.isOnGround()
|
||||
, player.isOnGround()
|
||||
//#else
|
||||
//#if MC>=10800
|
||||
, player.onGround
|
||||
//$$ , player.onGround
|
||||
//#endif
|
||||
//#endif
|
||||
);
|
||||
@@ -239,7 +239,7 @@ public class RecordingEventHandler extends EventRegistrations {
|
||||
|
||||
//Animation Packets
|
||||
//Swing Animation
|
||||
if (player.isHandSwinging && player.handSwingTicks == 0) {
|
||||
if (player.handSwinging && player.handSwingTicks == 0) {
|
||||
packetListener.save(new EntityAnimationS2CPacket(
|
||||
player,
|
||||
//#if MC>=10904
|
||||
@@ -277,9 +277,9 @@ public class RecordingEventHandler extends EventRegistrations {
|
||||
if (playerItems[slot.ordinal()] != stack) {
|
||||
playerItems[slot.ordinal()] = stack;
|
||||
//#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
|
||||
packetListener.save(new EntityEquipmentUpdateS2CPacket(player.getEntityId(), slot, stack));
|
||||
//$$ packetListener.save(new EntityEquipmentUpdateS2CPacket(player.getEntityId(), slot, stack));
|
||||
//#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.spongepowered.asm.mixin.injection.At;
|
||||
import java.io.File;
|
||||
|
||||
//#if MC>=11600
|
||||
//$$ import net.minecraft.resource.ResourcePackSource;
|
||||
import net.minecraft.resource.ResourcePackSource;
|
||||
//#endif
|
||||
|
||||
//#if MC>=10800
|
||||
@@ -37,7 +37,7 @@ public abstract class MixinDownloadingPackFinder implements ResourcePackRecorder
|
||||
private void recordDownloadedPack(
|
||||
File file,
|
||||
//#if MC>=11600
|
||||
//$$ ResourcePackSource arg,
|
||||
ResourcePackSource arg,
|
||||
//#endif
|
||||
CallbackInfoReturnable ci
|
||||
) {
|
||||
|
||||
@@ -14,13 +14,13 @@ import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
||||
@Mixin(Mouse.class)
|
||||
public abstract class MixinMouseHelper {
|
||||
@Shadow
|
||||
private boolean isCursorLocked;
|
||||
private boolean cursorLocked;
|
||||
|
||||
@Inject(method = "lockCursor", at = @At("HEAD"), cancellable = true)
|
||||
private void noGrab(CallbackInfo ci) {
|
||||
// Used to be provided by Forge for 1.12.2 and below
|
||||
if (Boolean.valueOf(System.getProperty("fml.noGrab", "false"))) {
|
||||
this.isCursorLocked = true;
|
||||
this.cursorLocked = true;
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.replaymod.replaystudio.protocol.PacketType;
|
||||
import com.replaymod.replaystudio.protocol.packets.PacketPlayerListEntry;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
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.client.network.PlayerListEntry;
|
||||
|
||||
|
||||
@@ -17,17 +17,17 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
//#if MC>=11600
|
||||
//$$ import net.minecraft.util.registry.RegistryKey;
|
||||
//$$ import net.minecraft.world.MutableWorldProperties;
|
||||
//$$ import java.util.function.Supplier;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.MutableWorldProperties;
|
||||
import java.util.function.Supplier;
|
||||
//#else
|
||||
import net.minecraft.world.level.LevelProperties;
|
||||
//$$ import net.minecraft.world.level.LevelProperties;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11400
|
||||
import net.minecraft.world.chunk.ChunkManager;
|
||||
//#if MC<11600
|
||||
import net.minecraft.world.dimension.Dimension;
|
||||
//$$ import net.minecraft.world.dimension.Dimension;
|
||||
//#endif
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import java.util.function.BiFunction;
|
||||
@@ -48,22 +48,22 @@ public abstract class MixinWorldClient extends World implements RecordingEventHa
|
||||
private MinecraftClient client;
|
||||
|
||||
//#if MC>=11600
|
||||
//$$ protected MixinWorldClient(MutableWorldProperties mutableWorldProperties, RegistryKey<World> registryKey,
|
||||
protected MixinWorldClient(MutableWorldProperties mutableWorldProperties, RegistryKey<World> registryKey,
|
||||
//#if MC<11602
|
||||
//$$ RegistryKey<DimensionType> registryKey2,
|
||||
//#endif
|
||||
//$$ DimensionType dimensionType, Supplier<Profiler> profiler, boolean bl, boolean bl2, long l) {
|
||||
//$$ super(mutableWorldProperties, registryKey,
|
||||
DimensionType dimensionType, Supplier<Profiler> profiler, boolean bl, boolean bl2, long l) {
|
||||
super(mutableWorldProperties, registryKey,
|
||||
//#if MC<11602
|
||||
//$$ registryKey2,
|
||||
//#endif
|
||||
//$$ dimensionType, profiler, bl, bl2, l);
|
||||
//$$ }
|
||||
dimensionType, profiler, bl, bl2, l);
|
||||
}
|
||||
//#else
|
||||
//#if MC>=11400
|
||||
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);
|
||||
}
|
||||
//$$ 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);
|
||||
//$$ }
|
||||
//#else
|
||||
//$$ protected MixinWorldClient(ISaveHandler saveHandlerIn,
|
||||
//#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.
|
||||
//#if MC>=11400
|
||||
//#if MC>=11600
|
||||
//$$ @Inject(method = "syncWorldEvent", at = @At("HEAD"))
|
||||
@Inject(method = "syncWorldEvent", at = @At("HEAD"))
|
||||
//#else
|
||||
@Inject(method = "playLevelEvent", at = @At("HEAD"))
|
||||
//$$ @Inject(method = "playLevelEvent", at = @At("HEAD"))
|
||||
//#endif
|
||||
private void playLevelEvent (PlayerEntity player, int type, BlockPos pos, int data, CallbackInfo ci) {
|
||||
//#else
|
||||
|
||||
@@ -36,7 +36,7 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.data.DataTracker;
|
||||
import net.minecraft.network.NetworkState;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.util.PacketByteBuf;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.util.crash.CrashReport;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
|
||||
@@ -140,7 +140,7 @@ public class Util {
|
||||
public static Vector3f getCameraPos() {
|
||||
MinecraftClient mc = MinecraftClient.getInstance();
|
||||
//#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);
|
||||
//#else
|
||||
//$$ return new Vector3f(
|
||||
|
||||
@@ -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
|
||||
Matrix4f.translate(new Vector3f(
|
||||
//#if MC>=11400
|
||||
(float) -mc.getEntityRenderManager().camera.getPos().x,
|
||||
(float) -mc.getEntityRenderManager().camera.getPos().y,
|
||||
(float) -mc.getEntityRenderManager().camera.getPos().z
|
||||
(float) -mc.getEntityRenderDispatcher().camera.getPos().x,
|
||||
(float) -mc.getEntityRenderDispatcher().camera.getPos().y,
|
||||
(float) -mc.getEntityRenderDispatcher().camera.getPos().z
|
||||
//#else
|
||||
//$$ (float) -mc.getRenderManager().viewerPosX,
|
||||
//$$ (float) -mc.getRenderManager().viewerPosY,
|
||||
|
||||
@@ -289,7 +289,7 @@ public class GuiVideoRenderer extends GuiScreen implements Tickable {
|
||||
buffer.get(); // alpha
|
||||
//#if MC>=11400
|
||||
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
|
||||
//$$ int value = 0xff << 24 | r << 16 | g << 8 | b;
|
||||
//$$ data[y * width + x] = value;
|
||||
|
||||
@@ -26,7 +26,7 @@ import net.minecraft.util.hit.HitResult;
|
||||
//#if MC>=11400
|
||||
import net.minecraft.client.options.GameOptions;
|
||||
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;
|
||||
//#else
|
||||
//$$ import com.replaymod.replay.camera.CameraEntity;
|
||||
@@ -217,7 +217,7 @@ public abstract class MixinEntityRenderer implements EntityRendererHandler.IEnti
|
||||
*/
|
||||
|
||||
//#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) {
|
||||
return replayModRender_perspective((float) fovY, aspect, zNear, zFar);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public abstract class MixinParticleManager {
|
||||
|
||||
buildGeometry(particle, vertexConsumer, camera, partialTicks);
|
||||
} finally {
|
||||
rotation.set(org.getA(), org.getB(), org.getC(), org.getD());
|
||||
rotation.set(org.getW(), org.getX(), org.getY(), org.getZ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.client.render.RenderTickCounter;
|
||||
|
||||
//#if MC>=11600
|
||||
//$$ import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11500
|
||||
@@ -167,7 +167,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
//#endif
|
||||
while (replayTime < videoStart) {
|
||||
//#if MC<11600
|
||||
timer.ticksThisFrame = 1;
|
||||
//$$ timer.ticksThisFrame = 1;
|
||||
//#endif
|
||||
replayTime += 50;
|
||||
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
|
||||
RenderTickCounter timer = ((MinecraftAccessor) mc).getTimer();
|
||||
//#if MC>=11600
|
||||
//$$ int elapsedTicks =
|
||||
int elapsedTicks =
|
||||
//#endif
|
||||
timer.beginRenderTick(
|
||||
//#if MC>=11400
|
||||
@@ -243,7 +243,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
//#endif
|
||||
);
|
||||
//#if MC<11600
|
||||
int elapsedTicks = timer.ticksThisFrame;
|
||||
//$$ int elapsedTicks = timer.ticksThisFrame;
|
||||
//#endif
|
||||
|
||||
executeTaskQueue();
|
||||
@@ -541,7 +541,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
mc.currentScreen = gui.toMinecraft();
|
||||
mc.overlay.render(
|
||||
//#if MC>=11600
|
||||
//$$ new MatrixStack(),
|
||||
new MatrixStack(),
|
||||
//#endif
|
||||
mouseX, mouseY, 0);
|
||||
} finally {
|
||||
@@ -551,7 +551,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
gui.toMinecraft().tick();
|
||||
gui.toMinecraft().render(
|
||||
//#if MC>=11600
|
||||
//$$ new MatrixStack(),
|
||||
new MatrixStack(),
|
||||
//#endif
|
||||
mouseX, mouseY, 0);
|
||||
}
|
||||
|
||||
@@ -27,8 +27,8 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.network.NetworkState;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.util.PacketByteBuf;
|
||||
import net.minecraft.network.packet.s2c.play.ChatMessageS2CPacket;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.network.packet.s2c.play.GameMessageS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.DisconnectS2CPacket;
|
||||
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.GameJoinS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.GameStateChangeS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.CloseContainerS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.OpenHorseContainerS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.ContainerSlotUpdateS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.ContainerPropertyUpdateS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.CloseScreenS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.OpenHorseScreenS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.ScreenHandlerSlotUpdateS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.ScreenHandlerPropertyUpdateS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.HealthUpdateS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.login.LoginSuccessS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.MobSpawnS2CPacket;
|
||||
@@ -66,14 +66,14 @@ import de.johni0702.minecraft.gui.versions.callbacks.PreTickCallback;
|
||||
|
||||
//#if MC>=11600
|
||||
//#else
|
||||
import net.minecraft.network.packet.s2c.play.EntitySpawnGlobalS2CPacket;
|
||||
//$$ import net.minecraft.network.packet.s2c.play.EntitySpawnGlobalS2CPacket;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11400
|
||||
import com.replaymod.core.versions.MCVer;
|
||||
import net.minecraft.network.packet.s2c.play.ChunkDataS2CPacket;
|
||||
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.entity.EntityType;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
@@ -150,7 +150,7 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
||||
//#endif
|
||||
//#if MC>=11400
|
||||
OpenWrittenBookS2CPacket.class,
|
||||
OpenContainerS2CPacket.class,
|
||||
OpenScreenS2CPacket.class,
|
||||
//#endif
|
||||
//#if MC>=11200
|
||||
SynchronizeRecipesS2CPacket.class,
|
||||
@@ -162,10 +162,10 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
||||
TitleS2CPacket.class,
|
||||
//#endif
|
||||
HealthUpdateS2CPacket.class,
|
||||
OpenHorseContainerS2CPacket.class,
|
||||
CloseContainerS2CPacket.class,
|
||||
ContainerSlotUpdateS2CPacket.class,
|
||||
ContainerPropertyUpdateS2CPacket.class,
|
||||
OpenHorseScreenS2CPacket.class,
|
||||
CloseScreenS2CPacket.class,
|
||||
ScreenHandlerSlotUpdateS2CPacket.class,
|
||||
ScreenHandlerPropertyUpdateS2CPacket.class,
|
||||
SignEditorOpenS2CPacket.class,
|
||||
StatisticsS2CPacket.class,
|
||||
ExperienceBarUpdateS2CPacket.class,
|
||||
@@ -427,7 +427,7 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
||||
|| p instanceof EntitySpawnS2CPacket
|
||||
|| p instanceof MobSpawnS2CPacket
|
||||
//#if MC<11600
|
||||
|| p instanceof EntitySpawnGlobalS2CPacket
|
||||
//$$ || p instanceof EntitySpawnGlobalS2CPacket
|
||||
//#endif
|
||||
|| p instanceof PaintingSpawnS2CPacket
|
||||
|| p instanceof ExperienceOrbSpawnS2CPacket
|
||||
@@ -617,27 +617,27 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
||||
entId,
|
||||
GameMode.SPECTATOR,
|
||||
//#if MC>=11600
|
||||
//$$ GameMode.SPECTATOR,
|
||||
GameMode.SPECTATOR,
|
||||
//#endif
|
||||
//#if MC>=11500
|
||||
packet.getSeed(),
|
||||
packet.getSha256Seed(),
|
||||
//#endif
|
||||
false,
|
||||
//#if MC>=11600
|
||||
//$$ packet.method_29443(),
|
||||
packet.method_29443(),
|
||||
//#if MC>=11602
|
||||
//$$ (net.minecraft.util.registry.DynamicRegistryManager.Impl) packet.getRegistryManager(),
|
||||
(net.minecraft.util.registry.DynamicRegistryManager.Impl) packet.getRegistryManager(),
|
||||
//#else
|
||||
//$$ (net.minecraft.util.registry.RegistryTracker.Modifiable) packet.getDimension(),
|
||||
//#endif
|
||||
//$$ packet.method_29444(),
|
||||
//$$ packet.getDimensionId(),
|
||||
packet.method_29444(),
|
||||
packet.getDimensionId(),
|
||||
//#else
|
||||
packet.getDimension(),
|
||||
//$$ packet.getDimension(),
|
||||
//#endif
|
||||
0, // max players (has no getter -> never actually used)
|
||||
//#if MC<11600
|
||||
packet.getGeneratorType(),
|
||||
//$$ packet.getGeneratorType(),
|
||||
//#endif
|
||||
packet.getChunkLoadDistance(),
|
||||
packet.hasReducedDebugInfo()
|
||||
@@ -645,8 +645,8 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
||||
, packet.showsDeathScreen()
|
||||
//#endif
|
||||
//#if MC>=11600
|
||||
//$$ , packet.isDebugWorld()
|
||||
//$$ , packet.isFlatWorld()
|
||||
, packet.isDebugWorld()
|
||||
, packet.isFlatWorld()
|
||||
//#endif
|
||||
);
|
||||
//#else
|
||||
@@ -688,21 +688,21 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
||||
//#if MC>=11400
|
||||
p = new PlayerRespawnS2CPacket(
|
||||
//#if MC>=11600
|
||||
//$$ respawn.method_29445(),
|
||||
respawn.method_29445(),
|
||||
//#endif
|
||||
respawn.getDimension(),
|
||||
//#if MC>=11500
|
||||
respawn.getSha256Seed(),
|
||||
//#endif
|
||||
//#if MC>=11600
|
||||
//$$ GameMode.SPECTATOR,
|
||||
//$$ GameMode.SPECTATOR,
|
||||
//$$ respawn.isDebugWorld(),
|
||||
//$$ respawn.isFlatWorld(),
|
||||
//$$ respawn.isWritingErrorSkippable()
|
||||
GameMode.SPECTATOR,
|
||||
GameMode.SPECTATOR,
|
||||
respawn.isDebugWorld(),
|
||||
respawn.isFlatWorld(),
|
||||
respawn.isWritingErrorSkippable()
|
||||
//#else
|
||||
respawn.getGeneratorType(),
|
||||
GameMode.SPECTATOR
|
||||
//$$ respawn.getGeneratorType(),
|
||||
//$$ GameMode.SPECTATOR
|
||||
//#endif
|
||||
);
|
||||
//#else
|
||||
@@ -792,22 +792,22 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
||||
// 8 - Fade time
|
||||
if (!Arrays.asList(
|
||||
//#if MC>=11600
|
||||
//$$ GameStateChangeS2CPacket.RAIN_STARTED,
|
||||
//$$ GameStateChangeS2CPacket.RAIN_STOPPED,
|
||||
//$$ GameStateChangeS2CPacket.RAIN_GRADIENT_CHANGED,
|
||||
//$$ GameStateChangeS2CPacket.THUNDER_GRADIENT_CHANGED
|
||||
GameStateChangeS2CPacket.RAIN_STARTED,
|
||||
GameStateChangeS2CPacket.RAIN_STOPPED,
|
||||
GameStateChangeS2CPacket.RAIN_GRADIENT_CHANGED,
|
||||
GameStateChangeS2CPacket.THUNDER_GRADIENT_CHANGED
|
||||
//#else
|
||||
1,
|
||||
2,
|
||||
7,
|
||||
8
|
||||
//$$ 1,
|
||||
//$$ 2,
|
||||
//$$ 7,
|
||||
//$$ 8
|
||||
//#endif
|
||||
).contains(pg.getReason())) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (p instanceof ChatMessageS2CPacket) {
|
||||
if (p instanceof GameMessageS2CPacket) {
|
||||
if (!ReplayModReplay.instance.getCore().getSettingsRegistry().get(Setting.SHOW_CHAT)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -47,9 +47,9 @@ public class InputReplayTimer extends WrappedTimer {
|
||||
@Override
|
||||
public
|
||||
//#if MC>=11600
|
||||
//$$ int
|
||||
int
|
||||
//#else
|
||||
void
|
||||
//$$ void
|
||||
//#endif
|
||||
beginRenderTick(
|
||||
//#if MC>=11400
|
||||
@@ -57,7 +57,7 @@ public class InputReplayTimer extends WrappedTimer {
|
||||
//#endif
|
||||
) {
|
||||
//#if MC>=11600
|
||||
//$$ int ticksThisFrame =
|
||||
int ticksThisFrame =
|
||||
//#endif
|
||||
super.beginRenderTick(
|
||||
//#if MC>=11400
|
||||
@@ -124,7 +124,7 @@ public class InputReplayTimer extends WrappedTimer {
|
||||
//#endif
|
||||
}
|
||||
//#if MC>=11600
|
||||
//$$ return ticksThisFrame;
|
||||
return ticksThisFrame;
|
||||
//#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import net.minecraft.network.packet.s2c.play.PlayerRespawnS2CPacket;
|
||||
import net.minecraft.network.NetworkState;
|
||||
import net.minecraft.network.NetworkSide;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.util.PacketByteBuf;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
//#if FABRIC>=1
|
||||
import de.johni0702.minecraft.gui.versions.callbacks.PreTickCallback;
|
||||
@@ -40,14 +40,14 @@ import java.util.Collections;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
//#if MC>=11602
|
||||
//$$ import net.minecraft.util.registry.DynamicRegistryManager;
|
||||
//$$ import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.util.registry.DynamicRegistryManager;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11600
|
||||
//$$ import net.minecraft.world.World;
|
||||
import net.minecraft.world.World;
|
||||
//#else
|
||||
import net.minecraft.world.level.LevelGeneratorType;
|
||||
//$$ import net.minecraft.world.level.LevelGeneratorType;
|
||||
//#endif
|
||||
//#if MC>=11400
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
@@ -201,31 +201,31 @@ public class QuickReplaySender extends ChannelHandlerAdapter implements ReplaySe
|
||||
ctx.fireChannelRead(new PlayerRespawnS2CPacket(
|
||||
//#if MC>=11600
|
||||
//#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
|
||||
//$$ DimensionType.OVERWORLD_REGISTRY_KEY,
|
||||
//#endif
|
||||
//$$ World.OVERWORLD,
|
||||
//$$ 0,
|
||||
//$$ GameMode.SPECTATOR,
|
||||
//$$ GameMode.SPECTATOR,
|
||||
//$$ false,
|
||||
//$$ false,
|
||||
//$$ false
|
||||
World.OVERWORLD,
|
||||
0,
|
||||
GameMode.SPECTATOR,
|
||||
GameMode.SPECTATOR,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
//#else
|
||||
//#if MC>=11400
|
||||
DimensionType.OVERWORLD,
|
||||
//$$ DimensionType.OVERWORLD,
|
||||
//#else
|
||||
//$$ 0,
|
||||
//#endif
|
||||
//#if MC>=11500
|
||||
0,
|
||||
//$$ 0,
|
||||
//#endif
|
||||
//#if MC<11400
|
||||
//$$ EnumDifficulty.NORMAL,
|
||||
//#endif
|
||||
LevelGeneratorType.DEFAULT,
|
||||
GameMode.SPECTATOR
|
||||
//$$ LevelGeneratorType.DEFAULT,
|
||||
//$$ GameMode.SPECTATOR
|
||||
//#endif
|
||||
));
|
||||
ctx.fireChannelRead(new PlayerPositionLookS2CPacket(0, 0, 0, 0, 0, Collections.emptySet(), 0));
|
||||
|
||||
@@ -39,7 +39,7 @@ import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
//#if MC>=11600
|
||||
//$$ import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11500
|
||||
@@ -644,10 +644,10 @@ public class ReplayHandler {
|
||||
resolution = newScaledResolution(mc);
|
||||
guiScreen.toMinecraft().init(mc, resolution.getScaledWidth(), resolution.getScaledHeight());
|
||||
//#if MC>=11600
|
||||
//$$ guiScreen.toMinecraft().render(new MatrixStack(), 0, 0, 0);
|
||||
guiScreen.toMinecraft().render(new MatrixStack(), 0, 0, 0);
|
||||
//#else
|
||||
//#if MC>=11400
|
||||
guiScreen.toMinecraft().render(0, 0, 0);
|
||||
//$$ guiScreen.toMinecraft().render(0, 0, 0);
|
||||
//#else
|
||||
//$$ guiScreen.toMinecraft().drawScreen(0, 0, 0);
|
||||
//#endif
|
||||
|
||||
@@ -64,7 +64,7 @@ import net.minecraft.util.hit.HitResult;
|
||||
import net.minecraft.entity.EquipmentSlot;
|
||||
//#if MC>=11200
|
||||
//#if MC>=11400
|
||||
import net.minecraft.client.recipe.book.ClientRecipeBook;
|
||||
import net.minecraft.client.recipebook.ClientRecipeBook;
|
||||
//#else
|
||||
//$$ import net.minecraft.stats.RecipeBook;
|
||||
//#endif
|
||||
@@ -150,8 +150,8 @@ public class CameraEntity
|
||||
, recipeBook
|
||||
//#endif
|
||||
//#if MC>=11600
|
||||
//$$ , false
|
||||
//$$ , false
|
||||
, false
|
||||
, false
|
||||
//#endif
|
||||
);
|
||||
eventHandler.register();
|
||||
@@ -321,8 +321,8 @@ public class CameraEntity
|
||||
|
||||
//#if MC>=11400
|
||||
@Override
|
||||
public boolean isInFluid(Tag<Fluid> fluid) {
|
||||
return falseUnlessSpectating(entity -> entity.isInFluid(fluid));
|
||||
public boolean isSubmergedIn(Tag<Fluid> fluid) {
|
||||
return falseUnlessSpectating(entity -> entity.isSubmergedIn(fluid));
|
||||
}
|
||||
//#else
|
||||
//#if MC>=10800
|
||||
|
||||
@@ -34,32 +34,32 @@ public class ClassicCameraController implements CameraController {
|
||||
speedup = false;
|
||||
for(KeyBinding kb : getMinecraft().options.keysAll) {
|
||||
if(!kb.isPressed()) continue;
|
||||
if(kb.getId().equals("key.forward")) {
|
||||
if(kb.getTranslationKey().equals("key.forward")) {
|
||||
forward = true;
|
||||
speedup = true;
|
||||
}
|
||||
|
||||
if(kb.getId().equals("key.back")) {
|
||||
if(kb.getTranslationKey().equals("key.back")) {
|
||||
backward = true;
|
||||
speedup = true;
|
||||
}
|
||||
|
||||
if(kb.getId().equals("key.jump")) {
|
||||
if(kb.getTranslationKey().equals("key.jump")) {
|
||||
up = true;
|
||||
speedup = true;
|
||||
}
|
||||
|
||||
if(kb.getId().equals("key.left")) {
|
||||
if(kb.getTranslationKey().equals("key.left")) {
|
||||
left = true;
|
||||
speedup = true;
|
||||
}
|
||||
|
||||
if(kb.getId().equals("key.right")) {
|
||||
if(kb.getTranslationKey().equals("key.right")) {
|
||||
right = true;
|
||||
speedup = true;
|
||||
}
|
||||
|
||||
if(kb.getId().equals("key.sneak")) {
|
||||
if(kb.getTranslationKey().equals("key.sneak")) {
|
||||
down = true;
|
||||
speedup = true;
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ import net.minecraft.client.gui.widget.AbstractButtonWidget;
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
|
||||
//#if MC>=11600
|
||||
//$$ import net.minecraft.text.Text;
|
||||
//$$ import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
//#endif
|
||||
|
||||
//#if FABRIC>=1
|
||||
@@ -62,18 +62,18 @@ public class GuiHandler extends EventRegistrations {
|
||||
mod.getReplayHandler().getReplaySender().setReplaySpeed(0);
|
||||
|
||||
//#if MC>=11600
|
||||
//$$ final TranslatableText BUTTON_OPTIONS = new TranslatableText("menu.options");
|
||||
//$$ final TranslatableText BUTTON_EXIT_SERVER = new TranslatableText("menu.disconnect");
|
||||
//$$ final TranslatableText BUTTON_ADVANCEMENTS = new TranslatableText("gui.advancements");
|
||||
//$$ final TranslatableText BUTTON_STATS = new TranslatableText("gui.stats");
|
||||
//$$ final TranslatableText BUTTON_OPEN_TO_LAN = new TranslatableText("menu.shareToLan");
|
||||
final TranslatableText BUTTON_OPTIONS = new TranslatableText("menu.options");
|
||||
final TranslatableText BUTTON_EXIT_SERVER = new TranslatableText("menu.disconnect");
|
||||
final TranslatableText BUTTON_ADVANCEMENTS = new TranslatableText("gui.advancements");
|
||||
final TranslatableText BUTTON_STATS = new TranslatableText("gui.stats");
|
||||
final TranslatableText BUTTON_OPEN_TO_LAN = new TranslatableText("menu.shareToLan");
|
||||
//#else
|
||||
//#if MC>=11400
|
||||
final String BUTTON_OPTIONS = I18n.translate("menu.options");
|
||||
final String BUTTON_EXIT_SERVER = I18n.translate("menu.disconnect");
|
||||
final String BUTTON_ADVANCEMENTS = I18n.translate("gui.advancements");
|
||||
final String BUTTON_STATS = I18n.translate("gui.stats");
|
||||
final String BUTTON_OPEN_TO_LAN = I18n.translate("menu.shareToLan");
|
||||
//$$ final String BUTTON_OPTIONS = I18n.translate("menu.options");
|
||||
//$$ final String BUTTON_EXIT_SERVER = I18n.translate("menu.disconnect");
|
||||
//$$ final String BUTTON_ADVANCEMENTS = I18n.translate("gui.advancements");
|
||||
//$$ final String BUTTON_STATS = I18n.translate("gui.stats");
|
||||
//$$ final String BUTTON_OPEN_TO_LAN = I18n.translate("menu.shareToLan");
|
||||
//#else
|
||||
//#if MC>=11400
|
||||
//$$ final int BUTTON_OPTIONS = 0;
|
||||
@@ -99,9 +99,9 @@ public class GuiHandler extends EventRegistrations {
|
||||
boolean remove = false;
|
||||
//#if MC>=11400
|
||||
//#if MC>=11600
|
||||
//$$ Text id = b.getMessage();
|
||||
Text id = b.getMessage();
|
||||
//#else
|
||||
String id = b.getMessage();
|
||||
//$$ String id = b.getMessage();
|
||||
//#endif
|
||||
if (id == null) {
|
||||
// likely a button of some third-part mod
|
||||
@@ -301,9 +301,9 @@ public class GuiHandler extends EventRegistrations {
|
||||
width,
|
||||
height,
|
||||
//#if MC>=11600
|
||||
//$$ new TranslatableText(buttonText)
|
||||
new TranslatableText(buttonText)
|
||||
//#else
|
||||
I18n.translate(buttonText)
|
||||
//$$ I18n.translate(buttonText)
|
||||
//#endif
|
||||
//#if MC>=11400
|
||||
, self -> onClick.accept((InjectedButton) self)
|
||||
|
||||
@@ -10,9 +10,9 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
//#if MC>=11600
|
||||
//$$ import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
//#else
|
||||
import net.minecraft.world.World;
|
||||
//$$ import net.minecraft.world.World;
|
||||
//#endif
|
||||
|
||||
import java.util.Queue;
|
||||
@@ -37,9 +37,9 @@ public abstract class MixinParticleManager {
|
||||
@Inject(method = "setWorld", at = @At("HEAD"))
|
||||
public void replayModReplay_clearParticleQueue(
|
||||
//#if MC>=11600
|
||||
//$$ ClientWorld world,
|
||||
ClientWorld world,
|
||||
//#else
|
||||
World world,
|
||||
//$$ World world,
|
||||
//#endif
|
||||
CallbackInfo ci) {
|
||||
//#if MC>=11400
|
||||
|
||||
@@ -19,7 +19,7 @@ import net.minecraft.client.world.ClientWorld;
|
||||
|
||||
//#if MC>=11200
|
||||
//#if MC>=11400
|
||||
import net.minecraft.client.recipe.book.ClientRecipeBook;
|
||||
import net.minecraft.client.recipebook.ClientRecipeBook;
|
||||
//#else
|
||||
//$$ import net.minecraft.stats.RecipeBook;
|
||||
//#endif
|
||||
@@ -52,9 +52,9 @@ public abstract class MixinPlayerControllerMP {
|
||||
|
||||
//#if MC>=11400
|
||||
//#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
|
||||
@Inject(method = "createPlayer", at=@At("HEAD"), cancellable = true)
|
||||
//$$ @Inject(method = "createPlayer", at=@At("HEAD"), cancellable = true)
|
||||
//#endif
|
||||
private void replayModReplay_createReplayCamera(
|
||||
//#if MC>=11400
|
||||
@@ -65,8 +65,8 @@ public abstract class MixinPlayerControllerMP {
|
||||
StatHandler statisticsManager,
|
||||
ClientRecipeBook recipeBookClient,
|
||||
//#if MC>=11600
|
||||
//$$ boolean lastIsHoldingSneakKey,
|
||||
//$$ boolean lastSprinting,
|
||||
boolean lastIsHoldingSneakKey,
|
||||
boolean lastSprinting,
|
||||
//#endif
|
||||
CallbackInfoReturnable<ClientPlayerEntity> ci
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user