1.13 is dead (followup to 8bc0b0a)

This commit is contained in:
Jonas Herzig
2020-03-30 01:27:57 +02:00
parent 49ea1ae40a
commit 8b7ef8d1e3
105 changed files with 300 additions and 300 deletions

View File

@@ -83,7 +83,7 @@ import net.minecraft.text.TranslatableText;
//$$ import java.util.Iterator;
//#endif
//#if MC>=11300
//#if MC>=11400
import net.minecraft.util.Identifier;
//#if MC<11400
//$$ import net.minecraft.world.dimension.DimensionType;
@@ -430,7 +430,7 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
//$$ int chunkX = entity.chunkCoordX;
//$$ int chunkY = entity.chunkCoordZ;
//$$
//#if MC>=11300
//#if MC>=11400
//$$ if (entity.addedToChunk && world.getChunkProvider().provideChunk(chunkX, chunkY, false, false) != null) {
//#else
//#if MC>=10904
@@ -531,14 +531,14 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
if (p instanceof CustomPayloadS2CPacket) {
CustomPayloadS2CPacket packet = (CustomPayloadS2CPacket) p;
//#if MC>=11300
//#if MC>=11400
Identifier channelName = packet.getChannel();
//#else
//$$ String channelName = packet.getChannelName();
//#endif
// On 1.14+ there's a dedicated OpenWrittenBookS2CPacket now
//#if MC<11400
//#if MC>=11300
//#if MC>=11400
//$$ if (SPacketCustomPayload.BOOK_OPEN.equals(channelName)) {
//#else
//$$ if ("MC|BOpen".equals(channelName)) {
@@ -599,13 +599,13 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
);
//#else
//#if MC>=10800
//#if MC>=11300
//#if MC>=11400
//$$ DimensionType dimension = packet.func_212642_e();
//#else
//$$ int dimension = packet.getDimension();
//#endif
//$$ EnumDifficulty difficulty = packet.getDifficulty();
//#if MC>=11300
//#if MC>=11400
//$$ int maxPlayers = 0; // literally never used by vanilla (i.e. no accessor)
//#else
//$$ int maxPlayers = packet.getMaxPlayers();
@@ -1089,7 +1089,7 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
//#if MC>=11400
// FIXME fabric
//#else
//#if MC>=11300
//#if MC>=11400
//$$ Chunk chunk = chunkProvider.provideChunk(x, z, false, false);
//#else
//$$ Chunk chunk = chunkProvider.provideChunk(x, z);
@@ -1106,7 +1106,7 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
//$$ // Needs to be called at least 4 times thanks to
//$$ // EntityOtherPlayerMP#otherPlayerMPPosRotationIncrements (max vanilla value is 3)
//$$ for (int i = 0; i < 4; i++) {
//#if MC>=11300
//#if MC>=11400
//$$ entity.tick();
//#else
//$$ entity.onUpdate();
@@ -1119,7 +1119,7 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
//$$ if (entity.chunkCoordX != chunkX || entity.chunkCoordZ != chunkZ) {
//$$ // Entity has left the chunk
//$$ chunk.removeEntityAtIndex(entity, entity.chunkCoordY);
//#if MC>=11300
//#if MC>=11400
//$$ Chunk newChunk = chunkProvider.provideChunk(chunkX, chunkZ, false, false);
//#else
//#if MC>=10904

View File

@@ -11,7 +11,7 @@ import net.minecraft.client.render.RenderTickCounter;
import com.replaymod.core.ReplayMod;
//#endif
//#if MC>=11300
//#if MC>=11400
import org.lwjgl.glfw.GLFW;
//#else
//$$ import net.minecraft.client.settings.KeyBinding;
@@ -46,12 +46,12 @@ public class InputReplayTimer extends WrappedTimer {
@Override
public void beginRenderTick(
//#if MC>=11300
//#if MC>=11400
long sysClock
//#endif
) {
super.beginRenderTick(
//#if MC>=11300
//#if MC>=11400
sysClock
//#endif
);
@@ -75,7 +75,7 @@ public class InputReplayTimer extends WrappedTimer {
// If we are in a replay, we have to manually process key and mouse events as the
// tick speed may vary or there may not be any ticks at all (when the replay is paused)
if (mod.getReplayHandler() != null && mc.world != null && mc.player != null) {
//#if MC>=11300
//#if MC>=11400
if (mc.currentScreen == null || mc.currentScreen.passEvents) {
GLFW.glfwPollEvents();
MCVer.processKeyBinds();

View File

@@ -16,11 +16,11 @@ import net.minecraft.client.util.ScreenshotUtils;
//$$ import net.minecraft.client.util.math.MatrixStack;
//#endif
//#if MC>=11300
//#if MC>=11400
import static com.replaymod.core.versions.MCVer.getWindow;
//#endif
//#if MC<11300
//#if MC<11400
//$$ import com.google.common.io.Files;
//$$ import org.apache.commons.io.FileUtils;
//$$ import java.io.File;
@@ -42,7 +42,7 @@ public class NoGuiScreenshot {
return;
}
//#if MC>=11300
//#if MC>=11400
int frameWidth = getWindow(mc).getFramebufferWidth(), frameHeight = getWindow(mc).getFramebufferHeight();
//#else
//$$ int frameWidth = mc.displayWidth, frameHeight = mc.displayHeight;
@@ -63,7 +63,7 @@ public class NoGuiScreenshot {
mc.getFramebuffer().beginWrite(true);
GlStateManager.enableTexture();
//#if MC>=11300
//#if MC>=11400
mc.gameRenderer.renderWorld(
MCVer.getRenderPartialTicks(),
System.nanoTime()
@@ -95,7 +95,7 @@ public class NoGuiScreenshot {
// The frame without GUI has been rendered
// Read it, create the screenshot and finish the future
try {
//#if MC>=11300
//#if MC>=11400
Image image = new Image(ScreenshotUtils.method_1663(frameWidth, frameHeight, mc.getFramebuffer()));
//#else
// We're using Minecraft's ScreenShotHelper even though it writes the screenshot to

View File

@@ -41,7 +41,7 @@ import java.util.*;
//$$ import org.lwjgl.opengl.GL11;
//#endif
//#if MC>=11300
//#if MC>=11400
import com.replaymod.replay.mixin.EntityLivingBaseAccessor;
import net.minecraft.client.util.Window;
import net.minecraft.entity.LivingEntity;
@@ -67,7 +67,7 @@ import net.minecraft.entity.LivingEntity;
import net.minecraft.network.NetworkSide;
//#if MC>=11400
//#else
//#if MC>=11300
//#if MC>=11400
//$$ import net.minecraftforge.fml.network.NetworkHooks;
//#else
//$$ import com.mojang.authlib.GameProfile;
@@ -168,7 +168,7 @@ public class ReplayHandler {
channel.close();
//#if MC>=11300
//#if MC>=11400
mc.mouse.unlockCursor();
//#else
//$$ mc.setIngameNotInFocus();
@@ -207,7 +207,7 @@ public class ReplayHandler {
channel.close().awaitUninterruptibly();
if (mc.player instanceof CameraEntity) {
//#if MC>=11300
//#if MC>=11400
mc.player.remove();
//#else
//$$ mc.player.setDead();
@@ -282,7 +282,7 @@ public class ReplayHandler {
networkManager,
mc,
null
//#if MC>=11300
//#if MC>=11400
, it -> {}
//#endif
));
@@ -302,7 +302,7 @@ public class ReplayHandler {
channel.pipeline().addLast("packet_handler", networkManager);
channel.pipeline().fireChannelActive();
//#if MC>=11300 && MC<11400
//#if MC>=11400 && MC<11400
//$$ NetworkHooks.registerClientLoginChannel(networkManager);
//#endif
}
@@ -546,7 +546,7 @@ public class ReplayHandler {
}
// Run previous tick
//#if MC>=11300
//#if MC>=11400
mc.tick();
//#else
//$$ try {
@@ -598,7 +598,7 @@ public class ReplayHandler {
//#endif
) {
@Override
//#if MC>=11300
//#if MC>=11400
public void render(int mouseX, int mouseY, float partialTicks) {
//#else
//$$ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
@@ -634,7 +634,7 @@ public class ReplayHandler {
//#if MC>=11400
getWindow(mc).method_4493(true);
//#else
//#if MC>=11300
//#if MC>=11400
//$$ mc.mainWindow.setupOverlayRendering();
//#else
//$$ mc.entityRenderer.setupOverlayRendering();
@@ -642,14 +642,14 @@ public class ReplayHandler {
//#endif
//#endif
//#if MC>=11300
//#if MC>=11400
Window
//#else
//$$ ScaledResolution
//#endif
resolution = newScaledResolution(mc);
guiScreen.init(mc, resolution.getScaledWidth(), resolution.getScaledHeight());
//#if MC>=11300
//#if MC>=11400
guiScreen.render(0, 0, 0);
//#else
//$$ guiScreen.drawScreen(0, 0, 0);
@@ -658,7 +658,7 @@ public class ReplayHandler {
mc.getFramebuffer().endWrite();
popMatrix();
pushMatrix();
//#if MC>=11300
//#if MC>=11400
mc.getFramebuffer().draw(getWindow(mc).getFramebufferWidth(), getWindow(mc).getFramebufferHeight());
//#else
//$$ mc.getFramebuffer().framebufferRender(mc.displayWidth, mc.displayHeight);
@@ -668,7 +668,7 @@ public class ReplayHandler {
//#if MC>=11500
//$$ getWindow(mc).swapBuffers();
//#else
//#if MC>=11300
//#if MC>=11400
getWindow(mc).setFullscreen(true);
//#else
//$$ Display.update();
@@ -687,7 +687,7 @@ public class ReplayHandler {
//#endif
mc.getNetworkHandler().getConnection()
//#if MC>=11300
//#if MC>=11400
.tick();
//#else
//$$ .processReceivedPackets();
@@ -700,7 +700,7 @@ public class ReplayHandler {
entity.prevYaw = entity.yaw;
entity.prevPitch = entity.pitch;
}
//#if MC>=10800 && MC<11300
//#if MC>=10800 && MC<11400
//$$ try {
//$$ mc.runTick();
//$$ } catch (IOException e) {
@@ -720,7 +720,7 @@ public class ReplayHandler {
}
private void skipTeleportInterpolation(Entity entity) {
//#if MC>=11300
//#if MC>=11400
if (entity instanceof LivingEntity && !(entity instanceof CameraEntity)) {
LivingEntity e = (LivingEntity) entity;
EntityLivingBaseAccessor ea = (EntityLivingBaseAccessor) e;

View File

@@ -54,7 +54,7 @@ import net.minecraft.util.hit.HitResult;
//$$ import net.minecraft.util.text.ITextComponent;
//$$ import net.minecraft.world.World;
//$$
//#if MC>=11300
//#if MC>=11400
//$$ import net.minecraft.util.math.RayTraceFluidMode;
//#else
//$$ import net.minecraft.block.material.Material;
@@ -65,7 +65,7 @@ import net.minecraft.util.hit.HitResult;
//#if MC>=10904
import net.minecraft.entity.EquipmentSlot;
//#if MC>=11200
//#if MC>=11300
//#if MC>=11400
import net.minecraft.client.recipe.book.ClientRecipeBook;
//#else
//$$ import net.minecraft.stats.RecipeBook;
@@ -136,7 +136,7 @@ public class CameraEntity
ClientPlayNetworkHandler netHandlerPlayClient,
StatHandler statisticsManager
//#if MC>=11200
//#if MC>=11300
//#if MC>=11400
, ClientRecipeBook recipeBook
//#else
//$$ , RecipeBook recipeBook
@@ -304,7 +304,7 @@ public class CameraEntity
return falseUnlessSpectating(Entity::isInsideWall); // Make sure no suffocation overlay is rendered
}
//#if MC<11300
//#if MC<11400
//$$ @Override
//$$ public boolean isInsideOfMaterial(Material materialIn) {
//$$ return falseUnlessSpectating(e -> e.isInsideOfMaterial(materialIn)); // Make sure no overlays are rendered
@@ -485,7 +485,7 @@ public class CameraEntity
return result;
}
//#else
//#if MC>=11300
//#if MC>=11400
//$$ @Override
//$$ public RayTraceResult rayTrace(double blockReachDistance, float partialTicks, RayTraceFluidMode p_174822_4_) {
//$$ RayTraceResult pos = super.rayTrace(blockReachDistance, partialTicks, p_174822_4_);
@@ -525,7 +525,7 @@ public class CameraEntity
//$$ }
//#endif
//#if MC<11300
//#if MC<11400
//$$ @Override
//$$ public void openGui(Object mod, int modGuiId, World world, int x, int y, int z) {
//$$ // Do not open any block GUIs for the camera entities

View File

@@ -12,7 +12,7 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.EquipmentSlot;
//#endif
//#if MC>=11300
//#if MC>=11400
//#else
//$$ import org.lwjgl.input.Mouse;
//#endif
@@ -41,7 +41,7 @@ public class SpectatorCameraController implements CameraController {
}
// Prevent mouse movement
//#if MC>=11300
//#if MC>=11400
// No longer needed
//#else
//$$ Mouse.updateCursor();

View File

@@ -1,4 +1,4 @@
//#if MC>=11300
//#if MC>=11400
package com.replaymod.replay.events;
import de.johni0702.minecraft.gui.utils.Event;

View File

@@ -1,4 +1,4 @@
//#if MC<11300
//#if MC<11400
//$$ package com.replaymod.replay.events;
//$$
//$$ import net.minecraftforge.fml.common.eventhandler.Cancelable;

View File

@@ -22,7 +22,7 @@ import de.johni0702.minecraft.gui.utils.lwjgl.WritablePoint;
import net.minecraft.client.options.GameOptions;
import net.minecraft.client.resource.language.I18n;
//#if MC>=11300
//#if MC>=11400
import com.replaymod.core.events.KeyBindingEventCallback;
import com.replaymod.core.events.KeyEventCallback;
//#else
@@ -176,7 +176,7 @@ public class GuiReplayOverlay extends AbstractGuiOverlay<GuiReplayOverlay> {
//$$ public // All event handlers need to be public in 1.7.10
//#endif
class EventHandler extends EventRegistrations {
//#if MC>=11300
//#if MC>=11400
{ on(KeyBindingEventCallback.EVENT, this::onKeyBindingEvent); }
private void onKeyBindingEvent() {
//#else
@@ -191,7 +191,7 @@ public class GuiReplayOverlay extends AbstractGuiOverlay<GuiReplayOverlay> {
}
}
//#if MC>=11300
//#if MC>=11400
{ on(KeyEventCallback.EVENT, (int key, int scanCode, int action, int modifiers) -> onKeyInput(key, action)); }
private void onKeyInput(int key, int action) {
if (action != 0) return;

View File

@@ -63,7 +63,7 @@ public class GuiHandler extends EventRegistrations {
final String BUTTON_STATS = I18n.translate("gui.stats");
final String BUTTON_OPEN_TO_LAN = I18n.translate("menu.shareToLan");
//#else
//#if MC>=11300
//#if MC>=11400
//$$ final int BUTTON_OPTIONS = 0;
//#endif
//$$ final int BUTTON_EXIT_SERVER = 1;
@@ -73,7 +73,7 @@ public class GuiHandler extends EventRegistrations {
//#endif
//#if MC<11300
//#if MC<11400
//$$ GuiButton openToLan = null;
//#endif
//#if MC>=11400
@@ -111,10 +111,10 @@ public class GuiHandler extends EventRegistrations {
stats = b;
} else if (id.equals(BUTTON_OPEN_TO_LAN)) {
remove = true;
//#if MC<11300
//#if MC<11400
//$$ openToLan = b;
//#endif
//#if MC>=11300
//#if MC>=11400
} else if (id.equals(BUTTON_OPTIONS)) {
//#if MC>=11400
width(b, 204);
@@ -134,7 +134,7 @@ public class GuiHandler extends EventRegistrations {
achievements.x, stats.x + width(stats));
}
// In 1.13+ Forge, the Options button shares one row with the Open to LAN button
//#if MC<11300
//#if MC<11400
//$$ if (openToLan != null) {
//$$ moveAllButtonsDirectlyBelowUpwards(buttonList, openToLan.y,
//$$ openToLan.x, openToLan.x + openToLan.width);
@@ -217,7 +217,7 @@ public class GuiHandler extends EventRegistrations {
addButton(guiScreen, button);
}
//#if MC>=11300
//#if MC>=11400
private void onButton(InjectedButton button) {
Screen guiScreen = button.guiScreen;
//#else
@@ -257,7 +257,7 @@ public class GuiHandler extends EventRegistrations {
public final int id;
private Consumer<InjectedButton> onClick;
public InjectedButton(Screen guiScreen, int buttonId, int x, int y, int width, int height, String buttonText,
//#if MC>=11300
//#if MC>=11400
Consumer<InjectedButton> onClick
//#else
//$$ Consumer<GuiScreenEvent.ActionPerformedEvent.Pre> onClick
@@ -278,14 +278,14 @@ public class GuiHandler extends EventRegistrations {
);
this.guiScreen = guiScreen;
this.id = buttonId;
//#if MC>=11300
//#if MC>=11400
this.onClick = onClick;
//#else
//$$ this.onClick = null;
//#endif
}
//#if MC>=11300 && MC<11400
//#if MC>=11400 && MC<11400
//$$ @Override
//$$ public void onClick(double mouseX, double mouseY) {
//$$ onClick.accept(this);

View File

@@ -6,7 +6,7 @@ import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(LivingEntity.class)
public interface EntityLivingBaseAccessor {
//#if MC>=11300
//#if MC>=11400
@Accessor("field_6224")
double getInterpTargetX();
@Accessor("field_6245")

View File

@@ -1,4 +1,4 @@
//#if MC<11300
//#if MC<11400
//$$ package com.replaymod.replay.mixin;
//$$
//$$ import net.minecraft.client.entity.EntityOtherPlayerMP;

View File

@@ -1,4 +1,4 @@
//#if MC>=11300
//#if MC>=11400
package com.replaymod.replay.mixin;
import com.replaymod.replay.camera.CameraEntity;

View File

@@ -7,20 +7,20 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
//#if MC>=11300
//#if MC>=11400
import net.minecraft.client.Keyboard;
//#else
//$$ import net.minecraft.client.Minecraft;
//#endif
//#if MC>=11300
//#if MC>=11400
@Mixin(Keyboard.class)
//#else
//$$ @Mixin(Minecraft.class)
//#endif
public abstract class MixinKeyboardListener {
@Inject(
//#if MC>=11300
//#if MC>=11400
method = "onKey",
//#else
//$$ method = "dispatchKeypresses",
@@ -30,7 +30,7 @@ public abstract class MixinKeyboardListener {
//#if MC>=11400
target = "Lnet/minecraft/client/util/ScreenshotUtils;method_1659(Ljava/io/File;IILnet/minecraft/client/gl/GlFramebuffer;Ljava/util/function/Consumer;)V"
//#else
//#if MC>=11300
//#if MC>=11400
//$$ target = "Lnet/minecraft/util/ScreenShotHelper;saveScreenshot(Ljava/io/File;IILnet/minecraft/client/shader/Framebuffer;Ljava/util/function/Consumer;)V"
//#else
//$$ target = "Lnet/minecraft/util/ScreenShotHelper;saveScreenshot(Ljava/io/File;IILnet/minecraft/client/shader/Framebuffer;)Lnet/minecraft/util/text/ITextComponent;"

View File

@@ -15,7 +15,7 @@ import java.util.Queue;
@Mixin(ParticleManager.class)
public abstract class MixinParticleManager {
@Shadow
//#if MC>=11300
//#if MC>=11400
private Queue<Particle> newParticles;
//#else
//$$ private Queue<Particle> queueEntityFX;
@@ -31,7 +31,7 @@ public abstract class MixinParticleManager {
*/
@Inject(method = "setWorld", at = @At("HEAD"))
public void replayModReplay_clearParticleQueue(World world, CallbackInfo ci) {
//#if MC>=11300
//#if MC>=11400
this.newParticles.clear();
//#else
//$$ this.queueEntityFX.clear();

View File

@@ -18,7 +18,7 @@ import net.minecraft.client.world.ClientWorld;
//#endif
//#if MC>=11200
//#if MC>=11300
//#if MC>=11400
import net.minecraft.client.recipe.book.ClientRecipeBook;
//#else
//$$ import net.minecraft.stats.RecipeBook;
@@ -50,7 +50,7 @@ public abstract class MixinPlayerControllerMP {
//$$ private NetHandlerPlayClient netClientHandler;
//#endif
//#if MC>=11300
//#if MC>=11400
@Inject(method = "createPlayer", at=@At("HEAD"), cancellable = true)
private void replayModReplay_createReplayCamera(
//#if MC>=11400
@@ -96,7 +96,7 @@ public abstract class MixinPlayerControllerMP {
}
//#if MC>=10800
//#if MC>=11300
//#if MC>=11400
@Inject(method = "isFlyingLocked", at=@At("HEAD"), cancellable = true)
//#else
//$$ @Inject(method = "isSpectator", at=@At("HEAD"), cancellable = true)

View File

@@ -7,7 +7,7 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
//#if MC>=11300
//#if MC>=11400
import net.minecraft.util.SystemUtil;
//#else
//$$ import net.minecraft.client.Minecraft;
@@ -15,7 +15,7 @@ import net.minecraft.util.SystemUtil;
@Mixin(ItemRenderer.class)
public class MixinRenderItem {
//#if MC>=11300
//#if MC>=11400
//#if MC>=11400
@Redirect(method = "renderGlint", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/SystemUtil;getMeasuringTimeMs()J"))
//#else
@@ -30,7 +30,7 @@ public class MixinRenderItem {
if (replayHandler != null) {
return replayHandler.getReplaySender().currentTimeStamp();
}
//#if MC>=11300
//#if MC>=11400
return SystemUtil.getMeasuringTimeMs();
//#else
//$$ return Minecraft.getSystemTime();

View File

@@ -7,7 +7,7 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
//#if MC>=11300
//#if MC>=11400
import net.minecraft.util.SystemUtil;
//#else
//$$ import net.minecraft.client.Minecraft;
@@ -15,7 +15,7 @@ import net.minecraft.util.SystemUtil;
@Mixin(EndPortalBlockEntityRenderer.class)
public class MixinTileEntityEndPortalRenderer {
//#if MC>=11300
//#if MC>=11400
@Redirect(method = "method_3591", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/SystemUtil;getMeasuringTimeMs()J"))
//#else
//#if MC>=11200
@@ -37,7 +37,7 @@ public class MixinTileEntityEndPortalRenderer {
if (replayHandler != null) {
return replayHandler.getReplaySender().currentTimeStamp();
}
//#if MC>=11300
//#if MC>=11400
return SystemUtil.getMeasuringTimeMs();
//#else
//$$ return Minecraft.getSystemTime();