Update to 1.21.2
This commit is contained in:
@@ -414,7 +414,9 @@ public class MCVer {
|
||||
//#else
|
||||
//$$ RenderSystem.getModelViewStack().pop();
|
||||
//#endif
|
||||
//#if MC<12102
|
||||
//$$ RenderSystem.applyModelViewMatrix();
|
||||
//#endif
|
||||
//#else
|
||||
GlStateManager.popMatrix();
|
||||
//#endif
|
||||
|
||||
@@ -62,8 +62,7 @@ public class SchedulerImpl implements Scheduler {
|
||||
super(string_1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Runnable createTask(Runnable runnable) {
|
||||
@Override public Runnable createTask(Runnable runnable) {
|
||||
return runnable;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ import net.minecraft.network.packet.s2c.play.BlockBreakingProgressS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.EntityAnimationS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.EntityAttachS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.EntityEquipmentUpdateS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.EntityPositionS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.EntityS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.EntitySetHeadYawS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.EntityVelocityUpdateS2CPacket;
|
||||
@@ -29,6 +28,13 @@ import net.minecraft.server.integrated.IntegratedServer;
|
||||
//$$ import net.minecraftforge.event.entity.player.PlayerEvent.ItemPickupEvent;
|
||||
//#endif
|
||||
|
||||
//#if MC>=12102
|
||||
//$$ import net.minecraft.entity.player.PlayerPosition;
|
||||
//$$ import net.minecraft.network.packet.s2c.play.EntityPositionSyncS2CPacket;
|
||||
//#else
|
||||
import net.minecraft.network.packet.s2c.play.EntityPositionS2CPacket;
|
||||
//#endif
|
||||
|
||||
//#if MC>=12002
|
||||
//$$ import net.minecraft.network.packet.s2c.play.EntitySpawnS2CPacket;
|
||||
//#else
|
||||
@@ -197,7 +203,9 @@ public class RecordingEventHandler extends EventRegistrations {
|
||||
|
||||
Packet packet;
|
||||
if (force || Math.abs(dx) > maxRelDist || Math.abs(dy) > maxRelDist || Math.abs(dz) > maxRelDist) {
|
||||
//#if MC>=10800
|
||||
//#if MC>=12102
|
||||
//$$ packet = new EntityPositionSyncS2CPacket(player.getId(), PlayerPosition.fromEntity(player), player.isOnGround());
|
||||
//#elseif MC>=10800
|
||||
packet = new EntityPositionS2CPacket(player);
|
||||
//#else
|
||||
//$$ // In 1.7.10 the client player entity has its posY at eye height
|
||||
|
||||
@@ -28,7 +28,9 @@ public abstract class MixinWorldClient extends World implements RecordingEventHa
|
||||
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
protected MixinWorldClient() {
|
||||
//#if MC>=11904
|
||||
//#if MC>=12102
|
||||
//$$ super(null, null, null, null, false, false, 0, 0);
|
||||
//#elseif MC>=11904
|
||||
//$$ super(null, null, null, null, null, false, false, 0, 0);
|
||||
//#elseif MC>=11900
|
||||
//$$ super(null, null, null, null, false, false, 0, 0);
|
||||
|
||||
@@ -84,7 +84,7 @@ public abstract class OpenGlFrameCapturer<F extends Frame, D extends CaptureData
|
||||
frameBuffer().beginWrite(true);
|
||||
|
||||
GlStateManager.clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT
|
||||
//#if MC>=11400
|
||||
//#if MC>=11400 && MC<12102
|
||||
, false
|
||||
//#endif
|
||||
);
|
||||
|
||||
@@ -293,7 +293,10 @@ public class GuiVideoRenderer extends GuiScreen implements Tickable {
|
||||
int g = buffer.get() & 0xff;
|
||||
int r = buffer.get() & 0xff;
|
||||
buffer.get(); // alpha
|
||||
//#if MC>=11400
|
||||
//#if MC>=12102
|
||||
//$$ int value = 0xff << 24 | r << 16 | g << 8 | b;
|
||||
//$$ data.setColorArgb(x, y, value);
|
||||
//#elseif MC>=11400
|
||||
int value = 0xff << 24 | b << 16 | g << 8 | r;
|
||||
data.setPixelColor(x, y, value); // actually takes ABGR, not RGBA
|
||||
//#else
|
||||
|
||||
@@ -68,17 +68,21 @@ public class VirtualWindow implements Closeable {
|
||||
}
|
||||
|
||||
public void beginWrite() {
|
||||
MinecraftClientExt.get(mc).setFramebufferDelegate(guiFramebuffer);
|
||||
guiFramebuffer.beginWrite(true);
|
||||
}
|
||||
|
||||
public void endWrite() {
|
||||
guiFramebuffer.endWrite();
|
||||
MinecraftClientExt.get(mc).setFramebufferDelegate(null);
|
||||
}
|
||||
|
||||
public void flip() {
|
||||
guiFramebuffer.draw(framebufferWidth, framebufferHeight);
|
||||
|
||||
//#if MC>=11500
|
||||
//#if MC>=12102
|
||||
//$$ window.swapBuffers(null);
|
||||
//#elseif MC>=11500
|
||||
window.swapBuffers();
|
||||
//#else
|
||||
//#if MC>=11400
|
||||
@@ -112,7 +116,7 @@ public class VirtualWindow implements Closeable {
|
||||
|
||||
//#if MC>=11400
|
||||
guiFramebuffer.resize(newWidth, newHeight
|
||||
//#if MC>=11400
|
||||
//#if MC>=11400 && MC<12102
|
||||
, false
|
||||
//#endif
|
||||
);
|
||||
|
||||
@@ -2,9 +2,11 @@ package com.replaymod.render.hooks;
|
||||
|
||||
import com.replaymod.render.gui.progress.VirtualWindow;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gl.Framebuffer;
|
||||
|
||||
public interface MinecraftClientExt {
|
||||
void setWindowDelegate(VirtualWindow window);
|
||||
void setFramebufferDelegate(Framebuffer framebuffer);
|
||||
|
||||
static MinecraftClientExt get(MinecraftClient mc) {
|
||||
return (MinecraftClientExt) mc;
|
||||
|
||||
@@ -9,6 +9,10 @@ import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
|
||||
//#if MC>=12102
|
||||
//$$ import net.minecraft.client.render.entity.EntityRenderer;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11500
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
@@ -31,7 +35,9 @@ public abstract class MixinRenderManager {
|
||||
//$$ @Shadow private float cameraYaw;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11500
|
||||
//#if MC>=12102
|
||||
//$$ @Inject(method = "render(Lnet/minecraft/entity/Entity;DDDFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;ILnet/minecraft/client/render/entity/EntityRenderer;)V", at = @At("HEAD"))
|
||||
//#elseif MC>=11500
|
||||
@Inject(method = "render", at = @At("HEAD"))
|
||||
//#else
|
||||
//#if MC>=11400 && FABRIC>=1
|
||||
@@ -45,7 +51,11 @@ public abstract class MixinRenderManager {
|
||||
//#endif
|
||||
//#endif
|
||||
//#if MC>=10904
|
||||
private void replayModRender_reorientForCubicRendering(Entity entity, double dx, double dy, double dz, float iDoNotKnow, float partialTicks,
|
||||
private void replayModRender_reorientForCubicRendering(Entity entity, double dx, double dy, double dz,
|
||||
//#if MC<12102
|
||||
float iDoNotKnow,
|
||||
//#endif
|
||||
float partialTicks,
|
||||
//#if MC>=11500
|
||||
MatrixStack matrixStack,
|
||||
VertexConsumerProvider vertexConsumerProvider,
|
||||
@@ -53,6 +63,9 @@ public abstract class MixinRenderManager {
|
||||
//#else
|
||||
//$$ boolean iDoNotCare,
|
||||
//#endif
|
||||
//#if MC>=12102
|
||||
//$$ EntityRenderer<?, ?> renderer,
|
||||
//#endif
|
||||
CallbackInfo ci) {
|
||||
//#else
|
||||
//$$ private void replayModRender_reorientForCubicRendering(Entity entity, double dx, double dy, double dz, float iDoNotKnow, float partialTicks, boolean iDoNotCare, CallbackInfoReturnable<Boolean> ci) {
|
||||
|
||||
@@ -21,6 +21,10 @@ import java.util.concurrent.locks.Condition;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
//#if MC>=12102
|
||||
//$$ import net.minecraft.util.thread.SimpleConsecutiveExecutor;
|
||||
//#endif
|
||||
|
||||
//#if MC>=12003
|
||||
//$$ import net.minecraft.client.render.chunk.BlockBufferBuilderPool;
|
||||
//#endif
|
||||
@@ -56,7 +60,11 @@ public abstract class Mixin_BlockOnChunkRebuilds implements ForceChunkLoadingHoo
|
||||
@Shadow public abstract boolean upload();
|
||||
//#endif
|
||||
|
||||
//#if MC>=12102
|
||||
//$$ @Shadow @Final private SimpleConsecutiveExecutor consecutiveExecutor;
|
||||
//#else
|
||||
@Shadow @Final private TaskExecutor<Runnable> mailbox;
|
||||
//#endif
|
||||
|
||||
@Shadow protected abstract void scheduleRunTasks();
|
||||
|
||||
@@ -99,10 +107,17 @@ public abstract class Mixin_BlockOnChunkRebuilds implements ForceChunkLoadingHoo
|
||||
}
|
||||
|
||||
private boolean waitForMainThreadWork() {
|
||||
//#if MC>=12102
|
||||
//$$ this.consecutiveExecutor.executeAsync(future -> {
|
||||
//$$ scheduleRunTasks();
|
||||
//$$ future.complete(getAvailableBufferCount() == this.totalBufferCount);
|
||||
//$$ }).join();
|
||||
//#else
|
||||
boolean allDone = this.mailbox.<Boolean>ask(reply -> () -> {
|
||||
scheduleRunTasks();
|
||||
reply.send(getAvailableBufferCount() == this.totalBufferCount);
|
||||
}).join();
|
||||
//#endif
|
||||
|
||||
if (allDone) {
|
||||
return true;
|
||||
|
||||
@@ -22,14 +22,20 @@ public abstract class Mixin_ChromaKeyColorSky {
|
||||
|
||||
//#if MC>=11800
|
||||
//$$ @Inject(
|
||||
//#if MC>=12005
|
||||
//#if MC>=12102
|
||||
//$$ method = "method_62215",
|
||||
//#elseif MC>=12005
|
||||
//$$ method = "renderSky(Lorg/joml/Matrix4f;Lorg/joml/Matrix4f;FLnet/minecraft/client/render/Camera;ZLjava/lang/Runnable;)V",
|
||||
//#elseif MC>=11802
|
||||
//$$ method = "renderSky(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/util/math/Matrix4f;FLnet/minecraft/client/render/Camera;ZLjava/lang/Runnable;)V",
|
||||
//#else
|
||||
//$$ method = "renderSky(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/util/math/Matrix4f;FLjava/lang/Runnable;)V",
|
||||
//#endif
|
||||
//$$ at = @At(value = "INVOKE", target = "Ljava/lang/Runnable;run()V", remap = false, shift = At.Shift.AFTER),
|
||||
//#if MC>=12102
|
||||
//$$ at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/RenderPhase$Target;startDrawing()V", shift = At.Shift.AFTER),
|
||||
//#else
|
||||
//$$ at = @At(value = "INVOKE", target = "Ljava/lang/Runnable;run()V", remap = false, shift = At.Shift.AFTER),
|
||||
//#endif
|
||||
//$$ cancellable = true)
|
||||
//#elseif MC>=11400 || 10710>=MC
|
||||
@Inject(method = "renderSky", at = @At("HEAD"), cancellable = true)
|
||||
@@ -43,7 +49,7 @@ public abstract class Mixin_ChromaKeyColorSky {
|
||||
if (color != null) {
|
||||
GlStateManager.clearColor(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, 1);
|
||||
GlStateManager.clear(GL11.GL_COLOR_BUFFER_BIT
|
||||
//#if MC>=11400
|
||||
//#if MC>=11400 && MC<12102
|
||||
, false
|
||||
//#endif
|
||||
);
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
package com.replaymod.render.mixin;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.replaymod.core.versions.MCVer;
|
||||
import com.replaymod.render.hooks.EntityRendererHandler;
|
||||
import net.minecraft.client.render.BackgroundRenderer;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
|
||||
//#if MC>=12102
|
||||
//$$ import net.minecraft.client.render.Fog;
|
||||
//$$ import net.minecraft.client.render.FogShape;
|
||||
//$$ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
//#else
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
//#endif
|
||||
|
||||
@Mixin(BackgroundRenderer.class)
|
||||
public abstract class Mixin_ChromaKeyDisableFog {
|
||||
@@ -16,7 +23,13 @@ public abstract class Mixin_ChromaKeyDisableFog {
|
||||
//#if MC>=11500
|
||||
static
|
||||
//#endif
|
||||
void replayModRender_onSetupFog(CallbackInfo ci) {
|
||||
void replayModRender_onSetupFog(
|
||||
//#if MC>=12102
|
||||
//$$ CallbackInfoReturnable<Fog> ci
|
||||
//#else
|
||||
CallbackInfo ci
|
||||
//#endif
|
||||
) {
|
||||
EntityRendererHandler handler =
|
||||
((EntityRendererHandler.IEntityRenderer) MCVer.getMinecraft().gameRenderer).replayModRender_getHandler();
|
||||
if (handler == null) return;
|
||||
@@ -30,9 +43,13 @@ public abstract class Mixin_ChromaKeyDisableFog {
|
||||
// start, as would be the case in these cases. Sodium doing math is also the reason we don't set start
|
||||
// equal to end (that'll result in undefined behavior because it sticks those into a smoothstep on old
|
||||
// versions), and we don't set it to MAX_VALUE because that also gives wrong results.
|
||||
//#if MC>=12102
|
||||
//$$ ci.setReturnValue(new Fog(1E10F, 2E10F, FogShape.CYLINDER, 0f, 0f, 0f, 0f));
|
||||
//#else
|
||||
GlStateManager.fogStart(1E10F);
|
||||
GlStateManager.fogEnd(2E10F);
|
||||
ci.cancel();
|
||||
//#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,11 @@ public abstract class Mixin_PreserveDepthDuringGuiRendering {
|
||||
@ModifyArg(
|
||||
//#if MC>=11500
|
||||
method = "render",
|
||||
//#if MC>=12102
|
||||
//$$ at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;clear(I)V"), index = 0
|
||||
//#else
|
||||
at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;clear(IZ)V"), index = 0
|
||||
//#endif
|
||||
//#elseif MC>=11400
|
||||
//$$ method = "method_4493",
|
||||
//$$ at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/platform/GlStateManager;clear(IZ)V"), index = 0
|
||||
|
||||
@@ -16,7 +16,11 @@ public abstract class Mixin_PreserveDepthDuringHandRendering {
|
||||
//$$ method = "renderWorldPass",
|
||||
//#endif
|
||||
//#if MC>=11500
|
||||
//#if MC>=12102
|
||||
//$$ at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;clear(I)V"),
|
||||
//#else
|
||||
at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;clear(IZ)V"),
|
||||
//#endif
|
||||
//#elseif MC>=11400
|
||||
//$$ at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/platform/GlStateManager;clear(IZ)V", ordinal = 1),
|
||||
//#else
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(MinecraftClient.class)
|
||||
public class Mixin_SuppressFramebufferResizeDuringRender implements MinecraftClientExt {
|
||||
public abstract class Mixin_SuppressFramebufferResizeDuringRender implements MinecraftClientExt {
|
||||
|
||||
@Unique
|
||||
private VirtualWindow windowDelegate;
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.replaymod.render.mixin;
|
||||
|
||||
import com.replaymod.render.hooks.MinecraftClientExt;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gl.Framebuffer;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(MinecraftClient.class)
|
||||
public abstract class Mixin_UseGuiFramebufferDuringGuiRendering implements MinecraftClientExt {
|
||||
|
||||
@Unique
|
||||
private Framebuffer framebufferDelegate;
|
||||
|
||||
@Override
|
||||
public void setFramebufferDelegate(Framebuffer framebuffer) {
|
||||
this.framebufferDelegate = framebuffer;
|
||||
}
|
||||
|
||||
@Inject(method = "getFramebuffer", at = @At("HEAD"), cancellable = true)
|
||||
private void useGuiFramebuffer(CallbackInfoReturnable<Framebuffer> ci) {
|
||||
Framebuffer delegate = this.framebufferDelegate;
|
||||
if (delegate != null) {
|
||||
ci.setReturnValue(delegate);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,10 @@ import net.minecraft.util.crash.CrashException;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
//#if MC>=12102
|
||||
//$$ import com.mojang.blaze3d.systems.ProjectionType;
|
||||
//#endif
|
||||
|
||||
//#if MC>=12000
|
||||
//$$ import com.mojang.blaze3d.systems.VertexSorter;
|
||||
//$$ import net.minecraft.client.gui.DrawContext;
|
||||
@@ -492,7 +496,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
|
||||
pushMatrix();
|
||||
GlStateManager.clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT
|
||||
//#if MC>=11400
|
||||
//#if MC>=11400 && MC<12102
|
||||
, false
|
||||
//#endif
|
||||
);
|
||||
@@ -502,7 +506,11 @@ public class VideoRenderer implements RenderInfo {
|
||||
guiWindow.beginWrite();
|
||||
|
||||
//#if MC>=11500
|
||||
//#if MC>=12102
|
||||
//$$ RenderSystem.clear(256);
|
||||
//#else
|
||||
RenderSystem.clear(256, MinecraftClient.IS_SYSTEM_MAC);
|
||||
//#endif
|
||||
//#if MC>=11700
|
||||
//$$ RenderSystem.setProjectionMatrix(Matrix4f.projectionMatrix(
|
||||
//$$ 0,
|
||||
@@ -512,7 +520,9 @@ public class VideoRenderer implements RenderInfo {
|
||||
//$$ 1000,
|
||||
//$$ 3000
|
||||
//$$ )
|
||||
//#if MC>=12000
|
||||
//#if MC>=12102
|
||||
//$$ , ProjectionType.ORTHOGRAPHIC
|
||||
//#elseif MC>=12000
|
||||
//$$ , VertexSorter.BY_Z
|
||||
//#endif
|
||||
//$$ );
|
||||
@@ -524,7 +534,9 @@ public class VideoRenderer implements RenderInfo {
|
||||
//$$ matrixStack.loadIdentity();
|
||||
//$$ matrixStack.translate(0, 0, -2000);
|
||||
//#endif
|
||||
//#if MC<12102
|
||||
//$$ RenderSystem.applyModelViewMatrix();
|
||||
//#endif
|
||||
//$$ DiffuseLighting.enableGuiDepthLighting();
|
||||
//#else
|
||||
RenderSystem.matrixMode(GL11.GL_PROJECTION);
|
||||
|
||||
@@ -83,6 +83,10 @@ import net.minecraft.network.packet.s2c.play.MobSpawnS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.PaintingSpawnS2CPacket;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11800
|
||||
//$$ import org.apache.commons.lang3.mutable.MutableBoolean;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11600
|
||||
//#else
|
||||
//$$ import net.minecraft.network.packet.s2c.play.EntitySpawnGlobalS2CPacket;
|
||||
@@ -437,7 +441,9 @@ public class FullReplaySender extends ChannelInboundHandlerAdapter implements Re
|
||||
ClientWorld world = mc.world;
|
||||
if (world != null) {
|
||||
//#if MC>=11800
|
||||
//$$ while (!world.hasNoChunkUpdaters()) {
|
||||
//$$ MutableBoolean done = new MutableBoolean();
|
||||
//$$ world.enqueueChunkUpdate(done::setTrue);
|
||||
//$$ while (!done.booleanValue()) {
|
||||
//$$ world.runQueuedChunkUpdates();
|
||||
//$$ }
|
||||
//#endif
|
||||
@@ -842,7 +848,11 @@ public class FullReplaySender extends ChannelInboundHandlerAdapter implements Re
|
||||
|
||||
//#if MC>=10800
|
||||
//#if MC>=11904
|
||||
//#if MC>=12102
|
||||
//$$ for (PositionFlag relative : ppl.relatives()) {
|
||||
//#else
|
||||
//$$ for (PositionFlag relative : ppl.getFlags()) {
|
||||
//#endif
|
||||
//$$ if (relative == PositionFlag.X || relative == PositionFlag.Y || relative == PositionFlag.Z) {
|
||||
//#elseif MC>=11400
|
||||
for (PlayerPositionLookS2CPacket.Flag relative : ppl.getFlags()) {
|
||||
@@ -876,14 +886,24 @@ public class FullReplaySender extends ChannelInboundHandlerAdapter implements Re
|
||||
}
|
||||
|
||||
CameraEntity cent = replayHandler.getCameraEntity();
|
||||
//#if MC>=12102
|
||||
//$$ if (!allowMovement && !((Math.abs(cent.getX() - ppl.change().position().x) > TP_DISTANCE_LIMIT) ||
|
||||
//$$ (Math.abs(cent.getZ() - ppl.change().position().z) > TP_DISTANCE_LIMIT))) {
|
||||
//#else
|
||||
if (!allowMovement && !((Math.abs(cent.getX() - ppl.getX()) > TP_DISTANCE_LIMIT) ||
|
||||
(Math.abs(cent.getZ() - ppl.getZ()) > TP_DISTANCE_LIMIT))) {
|
||||
//#endif
|
||||
return;
|
||||
} else {
|
||||
allowMovement = false;
|
||||
}
|
||||
//#if MC>=12102
|
||||
//$$ cent.setCameraPosition(ppl.change().position().x, ppl.change().position().y, ppl.change().position().z);
|
||||
//$$ cent.setCameraRotation(ppl.change().yaw(), ppl.change().pitch(), cent.roll);
|
||||
//#else
|
||||
cent.setCameraPosition(ppl.getX(), ppl.getY(), ppl.getZ());
|
||||
cent.setCameraRotation(ppl.getYaw(), ppl.getPitch(), cent.roll);
|
||||
//#endif
|
||||
}
|
||||
});
|
||||
|
||||
@@ -951,6 +971,9 @@ public class FullReplaySender extends ChannelInboundHandlerAdapter implements Re
|
||||
//$$ org.isFlat(),
|
||||
//$$ org.lastDeathLocation(),
|
||||
//$$ org.portalCooldown()
|
||||
//#if MC>=12102
|
||||
//$$ , org.seaLevel()
|
||||
//#endif
|
||||
//$$ );
|
||||
//$$ }
|
||||
//#endif
|
||||
|
||||
@@ -68,7 +68,7 @@ public class NoGuiScreenshot {
|
||||
pushMatrix();
|
||||
GlStateManager.clear(
|
||||
16640
|
||||
//#if MC>=11400
|
||||
//#if MC>=11400 && MC<12102
|
||||
, true
|
||||
//#endif
|
||||
);
|
||||
|
||||
@@ -45,6 +45,10 @@ import net.minecraft.network.ClientConnection;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
//#if MC>=12102
|
||||
//$$ import com.mojang.blaze3d.systems.ProjectionType;
|
||||
//#endif
|
||||
|
||||
//#if MC>=12006
|
||||
//$$ import net.minecraft.network.handler.NetworkStateTransitions;
|
||||
//$$ import net.minecraft.network.state.LoginStates;
|
||||
@@ -710,7 +714,7 @@ public class ReplayHandler {
|
||||
// Perform the rendering using OpenGL
|
||||
pushMatrix();
|
||||
GlStateManager.clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT
|
||||
//#if MC>=11400
|
||||
//#if MC>=11400 && MC<12102
|
||||
, true
|
||||
//#endif
|
||||
);
|
||||
@@ -720,7 +724,11 @@ public class ReplayHandler {
|
||||
mc.getFramebuffer().beginWrite(true);
|
||||
Window window = mc.getWindow();
|
||||
//#if MC>=11500
|
||||
//#if MC>=12102
|
||||
//$$ RenderSystem.clear(256);
|
||||
//#else
|
||||
RenderSystem.clear(256, MinecraftClient.IS_SYSTEM_MAC);
|
||||
//#endif
|
||||
//#if MC>=11700
|
||||
//$$ RenderSystem.setProjectionMatrix(Matrix4f.projectionMatrix(
|
||||
//$$ 0,
|
||||
@@ -730,7 +738,9 @@ public class ReplayHandler {
|
||||
//$$ 1000,
|
||||
//$$ 3000
|
||||
//$$ )
|
||||
//#if MC>=12000
|
||||
//#if MC>=12102
|
||||
//$$ , ProjectionType.ORTHOGRAPHIC
|
||||
//#elseif MC>=12000
|
||||
//$$ , VertexSorter.BY_Z
|
||||
//#endif
|
||||
//$$ );
|
||||
@@ -742,7 +752,9 @@ public class ReplayHandler {
|
||||
//$$ matrixStack.loadIdentity();
|
||||
//$$ matrixStack.translate(0, 0, -2000);
|
||||
//#endif
|
||||
//#if MC<12102
|
||||
//$$ RenderSystem.applyModelViewMatrix();
|
||||
//#endif
|
||||
//$$ DiffuseLighting.enableGuiDepthLighting();
|
||||
//#else
|
||||
RenderSystem.matrixMode(GL11.GL_PROJECTION);
|
||||
@@ -782,7 +794,9 @@ public class ReplayHandler {
|
||||
mc.getFramebuffer().draw(mc.getWindow().getFramebufferWidth(), mc.getWindow().getFramebufferHeight());
|
||||
popMatrix();
|
||||
|
||||
//#if MC>=11500
|
||||
//#if MC>=12102
|
||||
//$$ mc.getWindow().swapBuffers(null);
|
||||
//#elseif MC>=11500
|
||||
mc.getWindow().swapBuffers();
|
||||
//#else
|
||||
//#if MC>=11400
|
||||
|
||||
@@ -454,7 +454,16 @@ public class CameraEntity
|
||||
//$$ }
|
||||
//#endif
|
||||
|
||||
//#if MC>=10800
|
||||
//#if MC>=12102
|
||||
//$$ @Override
|
||||
//$$ public float getFovMultiplier(boolean firstPerson, float fovEffectScale) {
|
||||
//$$ Entity view = this.client.getCameraEntity();
|
||||
//$$ if (view != this && view instanceof AbstractClientPlayerEntity) {
|
||||
//$$ return ((AbstractClientPlayerEntity) view).getFovMultiplier(firstPerson, fovEffectScale);
|
||||
//$$ }
|
||||
//$$ return 1;
|
||||
//$$ }
|
||||
//#elseif MC>=10800
|
||||
@Override
|
||||
public float getSpeed() {
|
||||
Entity view = this.client.getCameraEntity();
|
||||
|
||||
@@ -28,7 +28,13 @@ public abstract class MixinRenderLivingBase {
|
||||
//#else
|
||||
//$$ @Inject(method = "canRenderName(Lnet/minecraft/entity/LivingEntity;)Z", at = @At("HEAD"), cancellable = true)
|
||||
//#endif
|
||||
private void replayModReplay_canRenderInvisibleName(LivingEntity entity, CallbackInfoReturnable<Boolean> ci) {
|
||||
private void replayModReplay_canRenderInvisibleName(
|
||||
LivingEntity entity,
|
||||
//#if MC>=12102
|
||||
//$$ double distSquared,
|
||||
//#endif
|
||||
CallbackInfoReturnable<Boolean> ci
|
||||
) {
|
||||
PlayerEntity thePlayer = getMinecraft().player;
|
||||
if (thePlayer instanceof CameraEntity && entity.isInvisible()) {
|
||||
ci.setReturnValue(false);
|
||||
@@ -36,7 +42,9 @@ public abstract class MixinRenderLivingBase {
|
||||
}
|
||||
|
||||
@Redirect(
|
||||
//#if MC>=11500
|
||||
//#if MC>=12102
|
||||
//$$ method = "updateRenderState(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/client/render/entity/state/LivingEntityRenderState;F)V",
|
||||
//#elseif MC>=11500
|
||||
method = "render",
|
||||
//#else
|
||||
//$$ method = "render(Lnet/minecraft/entity/LivingEntity;FFFFFF)V",
|
||||
|
||||
@@ -3,16 +3,25 @@ package com.replaymod.replay.mixin.world_border;
|
||||
import com.replaymod.core.versions.MCVer;
|
||||
import com.replaymod.replay.ReplayHandler;
|
||||
import com.replaymod.replay.ReplayModReplay;
|
||||
import net.minecraft.client.render.WorldRenderer;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
//#if MC>=12102
|
||||
//$$ import net.minecraft.client.render.WorldBorderRendering;
|
||||
//#else
|
||||
import net.minecraft.client.render.WorldRenderer;
|
||||
//#endif
|
||||
|
||||
/**
|
||||
* Normally Minecraft's world border texture animation is based off real time;
|
||||
* this redirect ensures that it is synced with the time in the Replay instead.
|
||||
*/
|
||||
//#if MC>=12102
|
||||
//$$ @Mixin(WorldBorderRendering.class)
|
||||
//#else
|
||||
@Mixin(WorldRenderer.class)
|
||||
//#endif
|
||||
public class Mixin_UseReplayTime_ForTexture {
|
||||
//#if MC>=11400
|
||||
@Redirect(method = "*", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Util;getMeasuringTimeMs()J"))
|
||||
|
||||
@@ -37,6 +37,10 @@ import static de.johni0702.minecraft.gui.versions.MCVer.popScissorState;
|
||||
import static de.johni0702.minecraft.gui.versions.MCVer.pushScissorState;
|
||||
import static de.johni0702.minecraft.gui.versions.MCVer.setScissorDisabled;
|
||||
|
||||
//#if MC>=12102
|
||||
//$$ import net.minecraft.client.gl.ShaderProgramKeys;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11700
|
||||
//$$ import com.mojang.blaze3d.systems.RenderSystem;
|
||||
//$$ import net.minecraft.client.render.GameRenderer;
|
||||
@@ -175,7 +179,9 @@ public class GuiKeyframeTimeline extends AbstractGuiTimeline<GuiKeyframeTimeline
|
||||
emitLine(matrixStack, buffer, p2, p3, color);
|
||||
emitLine(matrixStack, buffer, p3, p4, color);
|
||||
|
||||
//#if MC>=11700
|
||||
//#if MC>=12102
|
||||
//$$ RenderSystem.setShader(ShaderProgramKeys.RENDERTYPE_LINES);
|
||||
//#elseif MC>=11700
|
||||
//$$ RenderSystem.setShader(GameRenderer::getRenderTypeLinesShader);
|
||||
//#else
|
||||
GL11.glEnable(GL11.GL_LINE_SMOOTH);
|
||||
|
||||
@@ -30,6 +30,10 @@ import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.apache.commons.lang3.tuple.Triple;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
//#if MC>=12102
|
||||
//$$ import net.minecraft.client.gl.ShaderProgramKeys;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11700
|
||||
//$$ import net.minecraft.client.render.GameRenderer;
|
||||
//#endif
|
||||
@@ -114,7 +118,9 @@ public class PathPreviewRenderer extends EventRegistrations {
|
||||
//#else
|
||||
//$$ RenderSystem.getModelViewStack().method_34425(matrixStack.peek().getModel());
|
||||
//#endif
|
||||
//#if MC<12102
|
||||
//$$ RenderSystem.applyModelViewMatrix();
|
||||
//#endif
|
||||
//#elseif MC>=11500
|
||||
RenderSystem.multMatrix(matrixStack.peek().getModel());
|
||||
//#endif
|
||||
@@ -257,7 +263,11 @@ public class PathPreviewRenderer extends EventRegistrations {
|
||||
emitLine(new MatrixStack(), buffer, Vector3f.sub(pos1, view, null), Vector3f.sub(pos2, view, null), color);
|
||||
|
||||
//#if MC>=11700
|
||||
//#if MC>=12102
|
||||
//$$ RenderSystem.setShader(ShaderProgramKeys.RENDERTYPE_LINES);
|
||||
//#else
|
||||
//$$ RenderSystem.setShader(GameRenderer::getRenderTypeLinesShader);
|
||||
//#endif
|
||||
//$$ RenderSystem.disableCull();
|
||||
//#endif
|
||||
GL11.glLineWidth(3);
|
||||
@@ -314,7 +324,9 @@ public class PathPreviewRenderer extends EventRegistrations {
|
||||
GL11.glRotatef(-mc.getEntityRenderDispatcher().camera.getYaw(), 0, 1, 0);
|
||||
GL11.glRotatef(mc.getEntityRenderDispatcher().camera.getPitch(), 1, 0, 0);
|
||||
|
||||
//#if MC>=11700
|
||||
//#if MC>=12102
|
||||
//$$ RenderSystem.setShader(ShaderProgramKeys.POSITION_TEX);
|
||||
//#elseif MC>=11700
|
||||
//$$ RenderSystem.applyModelViewMatrix();
|
||||
//$$ RenderSystem.setShader(GameRenderer::getPositionTexShader);
|
||||
//#endif
|
||||
@@ -352,7 +364,9 @@ public class PathPreviewRenderer extends EventRegistrations {
|
||||
|
||||
emitLine(new MatrixStack(), buffer, new Vector3f(0, 0, 0), new Vector3f(0, 0, 2), 0x00ff00aa);
|
||||
|
||||
//#if MC>=11700
|
||||
//#if MC>=12102
|
||||
//$$ RenderSystem.setShader(ShaderProgramKeys.RENDERTYPE_LINES);
|
||||
//#elseif MC>=11700
|
||||
//$$ RenderSystem.applyModelViewMatrix();
|
||||
//$$ RenderSystem.setShader(GameRenderer::getRenderTypeLinesShader);
|
||||
//#else
|
||||
@@ -423,7 +437,9 @@ public class PathPreviewRenderer extends EventRegistrations {
|
||||
buffer.vertex(r + cubeSize, r + cubeSize, r + cubeSize).texture(2*8/64f, 8/64f).color(255, 255, 255, 200).next();
|
||||
buffer.vertex(r + cubeSize, r + cubeSize, r).texture(2 * 8 / 64f, 0).color(255, 255, 255, 200).next();
|
||||
|
||||
//#if MC>=11700
|
||||
//#if MC>=12102
|
||||
//$$ RenderSystem.setShader(ShaderProgramKeys.POSITION_TEX_COLOR);
|
||||
//#elseif MC>=11700
|
||||
//$$ RenderSystem.applyModelViewMatrix();
|
||||
//$$ RenderSystem.setShader(GameRenderer::getPositionTexColorShader);
|
||||
//#endif
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
"Mixin_Stereoscopic_Camera",
|
||||
"Mixin_Stereoscopic_HandRenderPass",
|
||||
"Mixin_SuppressFramebufferResizeDuringRender",
|
||||
"Mixin_UseGuiFramebufferDuringGuiRendering",
|
||||
//#if MC>=11600
|
||||
"Mixin_AddIrisOdsShaderUniforms",
|
||||
"Mixin_LoadIrisOdsShaderPack",
|
||||
|
||||
@@ -46,7 +46,9 @@
|
||||
//#if MC<11400
|
||||
//$$ "MixinRenderManager",
|
||||
//#endif
|
||||
//#if MC<12102
|
||||
"MixinViewFrustum",
|
||||
//#endif
|
||||
//#else
|
||||
//$$ "MixinEntityRenderer",
|
||||
//$$ "MixinFMLClientHandler",
|
||||
|
||||
Reference in New Issue
Block a user