1.13 is dead (followup to 8bc0b0a)
This commit is contained in:
@@ -15,7 +15,7 @@ import java.util.Optional;
|
||||
|
||||
import static com.replaymod.render.ReplayModRender.LOGGER;
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
import org.apache.maven.artifact.versioning.ComparableVersion;
|
||||
//#else
|
||||
//#if MC>=10800
|
||||
|
||||
@@ -148,7 +148,7 @@ public class BlendMeshBuilder
|
||||
}
|
||||
|
||||
public static DMesh addBufferToMesh(ByteBuffer buffer, int mode, VertexFormat vertexFormat, DMesh mesh, ReadableVector3f vertOffset) {
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
int vertexCount = buffer.remaining() / vertexFormat.getVertexSize();
|
||||
//#else
|
||||
//$$ int vertexCount = buffer.remaining() / vertexFormat.getNextOffset();
|
||||
@@ -222,7 +222,7 @@ public class BlendMeshBuilder
|
||||
List<DMesh.Vertex> vertices = new ArrayList<>(vertexCount);
|
||||
List<Vector2f> uvs = new ArrayList<>(vertexCount);
|
||||
List<Integer> colors = new ArrayList<>(vertexCount);
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
int step = vertexFormat.getVertexSize();
|
||||
//#else
|
||||
//$$ int step = vertexFormat.getNextOffset();
|
||||
|
||||
@@ -42,7 +42,7 @@ public class Util {
|
||||
private static FloatBuffer floatBuffer = GlAllocationUtils.allocateFloatBuffer(16);
|
||||
public static Matrix4f getGlMatrix(int matrix) {
|
||||
floatBuffer.clear();
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
GL11.glGetFloatv(matrix, floatBuffer);
|
||||
//#else
|
||||
//$$ GL11.glGetFloat(matrix, floatBuffer);
|
||||
@@ -184,7 +184,7 @@ public class Util {
|
||||
|
||||
public static String getTileEntityId(BlockEntity tileEntity) {
|
||||
CompoundTag nbt = new CompoundTag();
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
tileEntity.toTag(nbt);
|
||||
//#else
|
||||
//$$ tileEntity.writeToNBT(nbt);
|
||||
|
||||
@@ -55,7 +55,7 @@ public class EntityExporter implements Exporter {
|
||||
if (entityObject == null) {
|
||||
entityObject = new DObject(DObject.Type.OB_EMPTY);
|
||||
entityObject.setParent(renderState.peekObject());
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
entityObject.id.name = entity.getName().getString();
|
||||
//#else
|
||||
//$$ entityObject.id.name = entity.getName();
|
||||
|
||||
@@ -16,7 +16,7 @@ import net.minecraft.util.math.Vec3i;
|
||||
//$$ import net.minecraftforge.client.model.pipeline.LightUtil;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
import net.minecraft.client.render.model.BakedQuad;
|
||||
import net.minecraft.client.render.model.BakedModel;
|
||||
//#else
|
||||
@@ -69,7 +69,7 @@ public class ItemExporter implements Exporter {
|
||||
}
|
||||
if (object == null) {
|
||||
object = new ItemBasedDObject(renderItem, model, stack);
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
object.id.name = stack.getName().getString();
|
||||
//#else
|
||||
//$$ object.id.name = stack.getDisplayName();
|
||||
@@ -92,7 +92,7 @@ public class ItemExporter implements Exporter {
|
||||
//$$ builder.setVertexFormat(DefaultVertexFormats.ITEM);
|
||||
//#endif
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
for (Direction face : Direction.values()) {
|
||||
renderQuads(renderItem, builder, model.getQuads(null, face, new Random()), stack);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.replaymod.render.blend.data.DMesh;
|
||||
import com.replaymod.render.blend.data.DObject;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
import net.minecraft.client.model.Box;
|
||||
import net.minecraft.client.model.Cuboid;
|
||||
//#else
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
//#if MC>=11400
|
||||
@Mixin(targets = "net.minecraft.client.render.WorldRenderer$ChunkInfo")
|
||||
//#else
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
//$$ @Mixin(targets = "net/minecraft/client/renderer/WorldRenderer$ContainerLocalRenderInformation")
|
||||
//#else
|
||||
//$$ @Mixin(targets = "net/minecraft/client/renderer/RenderGlobal$ContainerLocalRenderInformation")
|
||||
|
||||
@@ -10,7 +10,7 @@ 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.render.chunk.ChunkRenderTask;
|
||||
//#else
|
||||
//$$ import net.minecraft.client.renderer.chunk.ChunkCompileTaskGenerator;
|
||||
@@ -20,7 +20,7 @@ import net.minecraft.client.render.chunk.ChunkRenderTask;
|
||||
public abstract class MixinChunkRenderWorker {
|
||||
|
||||
@Inject(method = "runTask", at = @At("RETURN"))
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
public void afterChunkUpdate(ChunkRenderTask task, CallbackInfo ci) {
|
||||
BlendState blendState = BlendState.getState();
|
||||
if (blendState != null) {
|
||||
|
||||
@@ -9,7 +9,7 @@ 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.model.Cuboid;
|
||||
//#else
|
||||
//$$ import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
@@ -16,13 +16,13 @@ import net.minecraft.client.render.Camera;
|
||||
//$$ import net.minecraft.entity.Entity;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
import net.minecraft.client.render.WorldRenderer;
|
||||
//#else
|
||||
//$$ import net.minecraft.client.renderer.RenderGlobal;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
@Mixin(WorldRenderer.class)
|
||||
//#else
|
||||
//$$ @Mixin(RenderGlobal.class)
|
||||
@@ -74,7 +74,7 @@ public abstract class MixinRenderGlobal {
|
||||
|
||||
@Inject(method = "renderEntities", at = @At(
|
||||
value = "INVOKE",
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
target = "Lnet/minecraft/client/render/block/entity/BlockEntityRenderDispatcher;render(Lnet/minecraft/block/entity/BlockEntity;FI)V"
|
||||
//#else
|
||||
//$$ target = "Lnet/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher;renderTileEntity(Lnet/minecraft/tileentity/TileEntity;FI)V"
|
||||
@@ -95,7 +95,7 @@ public abstract class MixinRenderGlobal {
|
||||
|
||||
@Inject(method = "renderEntities", at = @At(
|
||||
value = "INVOKE",
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
target = "Lnet/minecraft/client/render/block/entity/BlockEntityRenderDispatcher;render(Lnet/minecraft/block/entity/BlockEntity;FI)V",
|
||||
//#else
|
||||
//$$ target = "Lnet/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher;renderTileEntity(Lnet/minecraft/tileentity/TileEntity;FI)V",
|
||||
|
||||
@@ -9,7 +9,7 @@ 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.render.item.ItemRenderer;
|
||||
import net.minecraft.client.render.model.BakedModel;
|
||||
//#else
|
||||
@@ -22,7 +22,7 @@ import net.minecraft.client.render.model.BakedModel;
|
||||
//#endif
|
||||
//#endif
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
@Mixin(ItemRenderer.class)
|
||||
//#else
|
||||
//$$ @Mixin(RenderItem.class)
|
||||
@@ -31,7 +31,7 @@ public abstract class MixinRenderItem {
|
||||
//#if MC>=11400
|
||||
@Inject(method = "renderItemModel", at = @At("HEAD"))
|
||||
//#else
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
//$$ @Inject(method = "renderModel(Lnet/minecraft/client/renderer/model/IBakedModel;Lnet/minecraft/item/ItemStack;)V",
|
||||
//$$ at = @At("HEAD"))
|
||||
//#else
|
||||
|
||||
@@ -30,7 +30,7 @@ public abstract class MixinRenderManager {
|
||||
//#if MC>=11400
|
||||
method = "render(Lnet/minecraft/entity/Entity;DDDFFZ)V",
|
||||
//#else
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
//$$ method = "renderEntity",
|
||||
//#else
|
||||
//$$ method = "doRenderEntity",
|
||||
@@ -65,7 +65,7 @@ public abstract class MixinRenderManager {
|
||||
//#if MC>=11400
|
||||
method = "render(Lnet/minecraft/entity/Entity;DDDFFZ)V",
|
||||
//#else
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
//$$ method = "renderEntity",
|
||||
//#else
|
||||
//$$ method = "doRenderEntity",
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
@Mixin(BlockEntityRenderDispatcher.class)
|
||||
public abstract class MixinTileEntityRendererDispatcher {
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
//#if MC>=11400
|
||||
@Inject(method = "renderEntity(Lnet/minecraft/block/entity/BlockEntity;DDDFIZ)V",
|
||||
at = @At("HEAD"))
|
||||
@@ -42,7 +42,7 @@ public abstract class MixinTileEntityRendererDispatcher {
|
||||
}
|
||||
}
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
//#if MC>=11400
|
||||
@Inject(method = "renderEntity(Lnet/minecraft/block/entity/BlockEntity;DDDFIZ)V",
|
||||
at = @At("RETURN"))
|
||||
|
||||
@@ -16,7 +16,7 @@ import org.lwjgl.opengl.GL12;
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
import com.replaymod.render.mixin.MainWindowAccessor;
|
||||
import static com.replaymod.core.versions.MCVer.getWindow;
|
||||
//#endif
|
||||
@@ -116,7 +116,7 @@ public abstract class OpenGlFrameCapturer<F extends Frame, D extends CaptureData
|
||||
}
|
||||
|
||||
protected void resize(int width, int height) {
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
GlFramebuffer fb = mc.getFramebuffer();
|
||||
if (fb.viewWidth != width || fb.viewHeight != height) {
|
||||
fb.resize(width, height
|
||||
|
||||
@@ -21,7 +21,7 @@ import net.minecraft.client.texture.NativeImageBackedTexture;
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
import net.minecraft.client.texture.NativeImage;
|
||||
//#endif
|
||||
|
||||
@@ -232,7 +232,7 @@ public class GuiVideoRenderer extends GuiScreen implements Tickable {
|
||||
final int videoHeight = videoSize.getHeight();
|
||||
|
||||
if (previewTexture == null) {
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
previewTexture = new NativeImageBackedTexture(videoWidth, videoHeight, true);
|
||||
//#else
|
||||
//$$ previewTexture = new DynamicTexture(videoWidth, videoHeight);
|
||||
@@ -270,7 +270,7 @@ public class GuiVideoRenderer extends GuiScreen implements Tickable {
|
||||
ByteBuffer buffer = frame.getByteBuffer();
|
||||
buffer.mark();
|
||||
synchronized (this) {
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
NativeImage data = previewTexture.getImage();
|
||||
assert data != null;
|
||||
//#else
|
||||
@@ -287,7 +287,7 @@ public class GuiVideoRenderer extends GuiScreen implements Tickable {
|
||||
int g = buffer.get() & 0xff;
|
||||
int r = buffer.get() & 0xff;
|
||||
buffer.get(); // alpha
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
int value = 0xff << 24 | b << 16 | g << 8 | r;
|
||||
data.setPixelRGBA(x, y, value); // actually takes ABGR, not RGBA
|
||||
//#else
|
||||
|
||||
@@ -25,13 +25,13 @@ import static com.replaymod.core.versions.MCVer.*;
|
||||
|
||||
public class ChunkLoadingRenderGlobal {
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
private final WorldRenderer hooked;
|
||||
//#else
|
||||
//$$ private final RenderGlobal hooked;
|
||||
//#endif
|
||||
private ChunkBatcher renderDispatcher;
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
private JailingQueue<ChunkRenderTask> workerJailingQueue;
|
||||
//#else
|
||||
//$$ private JailingQueue<ChunkCompileTaskGenerator> workerJailingQueue;
|
||||
@@ -41,7 +41,7 @@ public class ChunkLoadingRenderGlobal {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public ChunkLoadingRenderGlobal(
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
WorldRenderer renderGlobal
|
||||
//#else
|
||||
//$$ RenderGlobal renderGlobal
|
||||
@@ -100,7 +100,7 @@ public class ChunkLoadingRenderGlobal {
|
||||
renderDispatcherAcc.setQueueChunkUpdates(queueChunkUpdates);
|
||||
|
||||
try {
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
Field hookField = WorldRenderer.class.getField("replayModRender_hook");
|
||||
//#else
|
||||
//$$ Field hookField = RenderGlobal.class.getField("replayModRender_hook");
|
||||
@@ -147,7 +147,7 @@ public class ChunkLoadingRenderGlobal {
|
||||
workerJailingQueue.freeAll();
|
||||
|
||||
try {
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
Field hookField = WorldRenderer.class.getField("replayModRender_hook");
|
||||
//#else
|
||||
//$$ Field hookField = RenderGlobal.class.getField("replayModRender_hook");
|
||||
|
||||
@@ -16,7 +16,7 @@ import net.minecraft.client.MinecraftClient;
|
||||
import com.replaymod.core.events.PostRenderCallback;
|
||||
import com.replaymod.core.events.PreRenderCallback;
|
||||
//#else
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
//$$ import net.minecraftforge.fml.hooks.BasicEventHooks;
|
||||
//#else
|
||||
//$$ import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
@@ -55,7 +55,7 @@ public class EntityRendererHandler implements WorldRenderer {
|
||||
//#if MC>=11400
|
||||
PreRenderCallback.EVENT.invoker().preRender();
|
||||
//#else
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
//$$ BasicEventHooks.onRenderTickStart(partialTicks);
|
||||
//#else
|
||||
//$$ FMLCommonHandler.instance().onRenderTickStart(partialTicks);
|
||||
@@ -75,7 +75,7 @@ public class EntityRendererHandler implements WorldRenderer {
|
||||
//#if MC>=11400
|
||||
PostRenderCallback.EVENT.invoker().postRender();
|
||||
//#else
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
//$$ BasicEventHooks.onRenderTickEnd(partialTicks);
|
||||
//#else
|
||||
//$$ FMLCommonHandler.instance().onRenderTickEnd(partialTicks);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
package com.replaymod.render.mixin;
|
||||
|
||||
import net.minecraft.client.util.Window;
|
||||
|
||||
@@ -52,7 +52,7 @@ public abstract class MixinCamera {
|
||||
boolean inverseView,
|
||||
//#endif
|
||||
float partialTicks,
|
||||
//#if MC<11300
|
||||
//#if MC<11400
|
||||
//$$ int renderPass,
|
||||
//#endif
|
||||
CallbackInfo ci
|
||||
@@ -110,7 +110,7 @@ public abstract class MixinCamera {
|
||||
boolean inverseView,
|
||||
//#endif
|
||||
float partialTicks,
|
||||
//#if MC<11300
|
||||
//#if MC<11400
|
||||
//$$ int renderPass,
|
||||
//#endif
|
||||
CallbackInfo ci
|
||||
|
||||
@@ -23,7 +23,7 @@ import net.minecraft.client.render.Camera;
|
||||
import net.minecraft.util.hit.HitResult;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
import net.minecraft.client.options.GameOptions;
|
||||
import net.minecraft.client.render.GameRenderer;
|
||||
import net.minecraft.client.util.math.Matrix4f;
|
||||
@@ -52,7 +52,7 @@ import com.mojang.blaze3d.platform.GlStateManager;
|
||||
|
||||
import static com.replaymod.core.versions.MCVer.*;
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
@Mixin(value = GameRenderer.class)
|
||||
//#else
|
||||
//$$ @Mixin(value = EntityRenderer.class)
|
||||
@@ -85,7 +85,7 @@ public abstract class MixinEntityRenderer implements EntityRendererHandler.IEnti
|
||||
//#endif
|
||||
|
||||
// Moved to MixinFogRenderer in 1.13
|
||||
//#if MC<11300
|
||||
//#if MC<11400
|
||||
//$$ @Inject(method = "setupFog", at = @At("HEAD"), cancellable = true)
|
||||
//$$ private void replayModRender_onSetupFog(int fogDistanceFlag, float partialTicks, CallbackInfo ci) {
|
||||
//$$ if (replayModRender_handler == null) return;
|
||||
@@ -104,7 +104,7 @@ public abstract class MixinEntityRenderer implements EntityRendererHandler.IEnti
|
||||
Camera camera,
|
||||
//#endif
|
||||
float partialTicks,
|
||||
//#if MC<11300
|
||||
//#if MC<11400
|
||||
//$$ int renderPass,
|
||||
//#endif
|
||||
CallbackInfo ci
|
||||
@@ -113,7 +113,7 @@ public abstract class MixinEntityRenderer implements EntityRendererHandler.IEnti
|
||||
if (replayModRender_handler.omnidirectional) {
|
||||
// No spectator hands during 360° view, we wouldn't even know where to put it
|
||||
ci.cancel();
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
}
|
||||
//#else
|
||||
//$$ } else {
|
||||
@@ -130,7 +130,7 @@ public abstract class MixinEntityRenderer implements EntityRendererHandler.IEnti
|
||||
}
|
||||
}
|
||||
|
||||
//#if MC<11300
|
||||
//#if MC<11400
|
||||
//$$ @Shadow
|
||||
//$$ public abstract void renderHand(float partialTicks, int renderPass);
|
||||
//#endif
|
||||
@@ -163,7 +163,7 @@ public abstract class MixinEntityRenderer implements EntityRendererHandler.IEnti
|
||||
//#endif
|
||||
private void replayModRender_setupStereoscopicProjection(
|
||||
float partialTicks,
|
||||
//#if MC<11300
|
||||
//#if MC<11400
|
||||
//$$ int renderPass,
|
||||
//#endif
|
||||
CallbackInfo ci
|
||||
@@ -197,7 +197,7 @@ public abstract class MixinEntityRenderer implements EntityRendererHandler.IEnti
|
||||
//#endif
|
||||
private void replayModRender_setupStereoscopicModelView(
|
||||
float partialTicks,
|
||||
//#if MC<11300
|
||||
//#if MC<11400
|
||||
//$$ int renderPass,
|
||||
//#endif
|
||||
CallbackInfo ci
|
||||
@@ -216,7 +216,7 @@ public abstract class MixinEntityRenderer implements EntityRendererHandler.IEnti
|
||||
* Cubic Renderer
|
||||
*/
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
@Redirect(method = "applyCameraTransformations", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/math/Matrix4f;method_4929(DFFF)Lnet/minecraft/client/util/math/Matrix4f;"))
|
||||
private Matrix4f replayModRender_perspective$0(double fovY, float aspect, float zNear, float zFar) {
|
||||
return replayModRender_perspective((float) fovY, aspect, zNear, zFar);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
package com.replaymod.render.mixin;
|
||||
|
||||
import com.replaymod.core.versions.MCVer;
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import net.minecraft.client.render.Camera;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
import net.minecraft.client.render.WorldRenderer;
|
||||
//#else
|
||||
//$$ import net.minecraft.client.renderer.RenderGlobal;
|
||||
@@ -27,7 +27,7 @@ import net.minecraft.client.render.WorldRenderer;
|
||||
//$$ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
@Mixin(WorldRenderer.class)
|
||||
//#else
|
||||
//$$ @Mixin(RenderGlobal.class)
|
||||
@@ -48,7 +48,7 @@ public abstract class MixinRenderGlobal {
|
||||
Camera viewEntity,
|
||||
//#else
|
||||
//$$ Entity viewEntity,
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
//$$ float partialTicks,
|
||||
//#else
|
||||
//$$ double partialTicks,
|
||||
@@ -65,7 +65,7 @@ public abstract class MixinRenderGlobal {
|
||||
Camera viewEntity,
|
||||
//#else
|
||||
//$$ Entity viewEntity,
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
//$$ float partialTicks,
|
||||
//#else
|
||||
//$$ double partialTicks,
|
||||
|
||||
@@ -37,7 +37,7 @@ public abstract class MixinRenderManager {
|
||||
//#if MC>=11400
|
||||
@Inject(method = "render(Lnet/minecraft/entity/Entity;DDDFFZ)V", at = @At("HEAD"))
|
||||
//#else
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
//$$ @Inject(method = "renderEntity", at = @At("HEAD"))
|
||||
//#else
|
||||
//$$ @Inject(method = "doRenderEntity", at = @At("HEAD"))
|
||||
|
||||
@@ -87,7 +87,7 @@ public abstract class Mixin_CubicRotation {
|
||||
//#if MC<11500
|
||||
if (getHandler() != null && getHandler().omnidirectional) {
|
||||
// Minecraft goes back a little so we have to revert that
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
GL11.glTranslatef(0.0F, 0.0F, -0.05F);
|
||||
//#else
|
||||
//$$ GL11.glTranslatef(0.0F, 0.0F, 0.1F);
|
||||
|
||||
@@ -7,7 +7,7 @@ import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.util.crash.CrashReport;
|
||||
import net.minecraft.util.crash.CrashException;
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
//#else
|
||||
//$$ import org.lwjgl.opengl.Display;
|
||||
@@ -61,7 +61,7 @@ public class Pipeline<R extends Frame, P extends Frame> implements Runnable {
|
||||
|
||||
MinecraftClient mc = MCVer.getMinecraft();
|
||||
while (!capturer.isDone() && !Thread.currentThread().isInterrupted()) {
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
if (GLFW.glfwWindowShouldClose(getWindow(mc).getHandle()) || ((MinecraftAccessor) mc).getCrashReporter() != null) {
|
||||
//#else
|
||||
//$$ if (Display.isCloseRequested() || ((MinecraftAccessor) mc).getCrashReporter() != null) {
|
||||
|
||||
@@ -38,7 +38,7 @@ import net.minecraft.client.render.RenderTickCounter;
|
||||
//$$ import org.lwjgl.opengl.GL11;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
import com.replaymod.render.mixin.MainWindowAccessor;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
//#else
|
||||
@@ -200,7 +200,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
@Override
|
||||
public float updateForNextFrame() {
|
||||
// because the jGui lib uses Minecraft's displayWidth and displayHeight values, update these temporarily
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
int displayWidthBefore = getWindow(mc).getFramebufferWidth();
|
||||
int displayHeightBefore = getWindow(mc).getFramebufferHeight();
|
||||
//noinspection ConstantConditions
|
||||
@@ -221,7 +221,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
// Updating the timer will cause the timeline player to update the game state
|
||||
RenderTickCounter timer = ((MinecraftAccessor) mc).getTimer();
|
||||
timer.beginRenderTick(
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
MCVer.milliTime()
|
||||
//#endif
|
||||
);
|
||||
@@ -238,7 +238,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
}
|
||||
|
||||
// change Minecraft's display size back
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
acc.setFramebufferWidth(displayWidthBefore);
|
||||
acc.setFramebufferHeight(displayHeightBefore);
|
||||
//#else
|
||||
@@ -269,7 +269,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
debugInfoWasShown = true;
|
||||
mc.options.debugEnabled = false;
|
||||
}
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
if (mc.mouse.isCursorLocked()) {
|
||||
mouseWasGrabbed = true;
|
||||
}
|
||||
@@ -341,7 +341,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
//#endif
|
||||
mc.options.debugEnabled = debugInfoWasShown;
|
||||
if (mouseWasGrabbed) {
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
mc.mouse.lockCursor();
|
||||
//#else
|
||||
//$$ mc.mouseHelper.grabMouseCursor();
|
||||
@@ -368,7 +368,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
}
|
||||
|
||||
// Finally, resize the Minecraft framebuffer to the actual width/height of the window
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
mc.getFramebuffer().resize(displayWidth, displayHeight
|
||||
//#if MC>=11400
|
||||
, false
|
||||
@@ -403,7 +403,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
//#endif
|
||||
|
||||
mc.currentScreen = gui.toMinecraft();
|
||||
//#if MC>=10800 && MC<11300
|
||||
//#if MC>=10800 && MC<11400
|
||||
//$$ try {
|
||||
//$$ mc.runTick();
|
||||
//$$ } catch (IOException e) {
|
||||
@@ -419,7 +419,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
// Resize the GUI framebuffer if the display size changed
|
||||
if (!settings.isHighPerformance() && displaySizeChanged()) {
|
||||
updateDisplaySize();
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
guiFramebuffer.resize(getWindow(mc).getFramebufferWidth(), getWindow(mc).getFramebufferHeight()
|
||||
//#if MC>=11400
|
||||
, false
|
||||
@@ -449,7 +449,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
//$$ RenderSystem.loadIdentity();
|
||||
//$$ RenderSystem.translatef(0, 0, -2000);
|
||||
//#else
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
getWindow(mc).method_4493(
|
||||
//#if MC>=11400
|
||||
false
|
||||
@@ -460,7 +460,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
//#endif
|
||||
//#endif
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
gui.toMinecraft().init(mc, getWindow(mc).getScaledWidth(), getWindow(mc).getScaledHeight());
|
||||
//#else
|
||||
//$$ ScaledResolution scaled = newScaledResolution(mc);
|
||||
@@ -468,7 +468,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
//#endif
|
||||
|
||||
// Events are polled on 1.13+ in mainWindow.update which is called later
|
||||
//#if MC<11300
|
||||
//#if MC<11400
|
||||
//#if MC>=10800
|
||||
//$$ try {
|
||||
//$$ gui.toMinecraft().handleInput();
|
||||
@@ -482,7 +482,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
//#endif
|
||||
//#endif
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
int mouseX = (int) mc.mouse.getX();
|
||||
int mouseY = (int) mc.mouse.getY();
|
||||
|
||||
@@ -505,7 +505,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
//#if MC>=11500
|
||||
//$$ getWindow(mc).swapBuffers();
|
||||
//#else
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
getWindow(mc).setFullscreen(false);
|
||||
//#else
|
||||
//$$ // if not in high performance mode, update the gui size if screen size changed
|
||||
@@ -521,7 +521,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
//$$ }
|
||||
//#endif
|
||||
//#endif
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
if (mc.mouse.isCursorLocked()) {
|
||||
mc.mouse.unlockCursor();
|
||||
}
|
||||
@@ -542,7 +542,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
}
|
||||
|
||||
private boolean displaySizeChanged() {
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
return displayWidth != getWindow(mc).getWidth() || displayHeight != getWindow(mc).getHeight();
|
||||
//#else
|
||||
//$$ return displayWidth != Display.getWidth() || displayHeight != Display.getHeight();
|
||||
@@ -550,7 +550,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
}
|
||||
|
||||
private void updateDisplaySize() {
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
displayWidth = getWindow(mc).getWidth();
|
||||
displayHeight = getWindow(mc).getHeight();
|
||||
//#else
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.lwjgl.opengl.ARBShaderObjects;
|
||||
import org.lwjgl.opengl.ARBVertexShader;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
import net.minecraft.resource.Resource;
|
||||
//#else
|
||||
//$$ import net.minecraft.client.resources.IResource;
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.replaymod.core.ReplayMod;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
import org.lwjgl.opengl.ARBVertexBufferObject;
|
||||
import org.lwjgl.opengl.GL;
|
||||
//#else
|
||||
@@ -20,7 +20,7 @@ import static org.lwjgl.opengl.ARBPixelBufferObject.*;
|
||||
import static org.lwjgl.opengl.GL15.*;
|
||||
import static org.lwjgl.opengl.GL21.GL_PIXEL_PACK_BUFFER;
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
import static org.lwjgl.opengl.ARBVertexBufferObject.*;
|
||||
//#endif
|
||||
|
||||
@@ -34,7 +34,7 @@ public class PixelBufferObject {
|
||||
private final int arb, gl15;
|
||||
}
|
||||
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
public static final boolean SUPPORTED = GL.getCapabilities().GL_ARB_pixel_buffer_object || GL.getCapabilities().OpenGL15;
|
||||
private static final boolean arb = !GL.getCapabilities().OpenGL15;
|
||||
//#else
|
||||
@@ -54,7 +54,7 @@ public class PixelBufferObject {
|
||||
}
|
||||
|
||||
this.size = size;
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
this.handle = arb ? ARBVertexBufferObject.glGenBuffersARB() : glGenBuffers();
|
||||
//#else
|
||||
//$$ this.handle = arb ? ARBBufferObject.glGenBuffersARB() : glGenBuffers();
|
||||
@@ -63,7 +63,7 @@ public class PixelBufferObject {
|
||||
bind();
|
||||
|
||||
if (arb) {
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
ARBVertexBufferObject.glBufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, size, usage.arb);
|
||||
//#else
|
||||
//$$ ARBBufferObject.glBufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, size, usage.arb);
|
||||
@@ -84,7 +84,7 @@ public class PixelBufferObject {
|
||||
|
||||
public void bind() {
|
||||
if (arb) {
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
ARBVertexBufferObject.glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, getHandle());
|
||||
//#else
|
||||
//$$ ARBBufferObject.glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, getHandle());
|
||||
@@ -98,7 +98,7 @@ public class PixelBufferObject {
|
||||
public void unbind() {
|
||||
checkBound();
|
||||
if (arb) {
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
ARBVertexBufferObject.glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0);
|
||||
//#else
|
||||
//$$ ARBBufferObject.glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0);
|
||||
@@ -126,7 +126,7 @@ public class PixelBufferObject {
|
||||
checkNotMapped();
|
||||
ByteBuffer buffer;
|
||||
if (arb) {
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
buffer = ARBVertexBufferObject.glMapBufferARB(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY_ARB, size, null);
|
||||
//#else
|
||||
//$$ buffer = ARBBufferObject.glMapBufferARB(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY_ARB, size, null);
|
||||
@@ -134,7 +134,7 @@ public class PixelBufferObject {
|
||||
} else {
|
||||
buffer = glMapBuffer(GL_PIXEL_PACK_BUFFER, GL_READ_ONLY, size, null);
|
||||
}
|
||||
//#if MC<11300
|
||||
//#if MC<11400
|
||||
//$$ if (buffer == null) {
|
||||
//$$ Util.checkGLError();
|
||||
//$$ }
|
||||
@@ -148,7 +148,7 @@ public class PixelBufferObject {
|
||||
checkNotMapped();
|
||||
ByteBuffer buffer;
|
||||
if (arb) {
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
buffer = ARBVertexBufferObject.glMapBufferARB(GL_PIXEL_PACK_BUFFER_ARB, GL_WRITE_ONLY_ARB, size, null);
|
||||
//#else
|
||||
//$$ buffer = ARBBufferObject.glMapBufferARB(GL_PIXEL_PACK_BUFFER_ARB, GL_WRITE_ONLY_ARB, size, null);
|
||||
@@ -156,7 +156,7 @@ public class PixelBufferObject {
|
||||
} else {
|
||||
buffer = glMapBuffer(GL_PIXEL_PACK_BUFFER, GL_WRITE_ONLY, size, null);
|
||||
}
|
||||
//#if MC<11300
|
||||
//#if MC<11400
|
||||
//$$ if (buffer == null) {
|
||||
//$$ Util.checkGLError();
|
||||
//$$ }
|
||||
@@ -170,7 +170,7 @@ public class PixelBufferObject {
|
||||
checkNotMapped();
|
||||
ByteBuffer buffer;
|
||||
if (arb) {
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
buffer = ARBVertexBufferObject.glMapBufferARB(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_WRITE_ARB, size, null);
|
||||
//#else
|
||||
//$$ buffer = ARBBufferObject.glMapBufferARB(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_WRITE_ARB, size, null);
|
||||
@@ -178,7 +178,7 @@ public class PixelBufferObject {
|
||||
} else {
|
||||
buffer = glMapBuffer(GL_PIXEL_PACK_BUFFER, GL_READ_WRITE, size, null);
|
||||
}
|
||||
//#if MC<11300
|
||||
//#if MC<11400
|
||||
//$$ if (buffer == null) {
|
||||
//$$ Util.checkGLError();
|
||||
//$$ }
|
||||
@@ -193,7 +193,7 @@ public class PixelBufferObject {
|
||||
throw new IllegalStateException("Buffer not mapped.");
|
||||
}
|
||||
if (arb) {
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
ARBVertexBufferObject.glUnmapBufferARB(GL_PIXEL_PACK_BUFFER_ARB);
|
||||
//#else
|
||||
//$$ ARBBufferObject.glUnmapBufferARB(GL_PIXEL_PACK_BUFFER_ARB);
|
||||
@@ -207,7 +207,7 @@ public class PixelBufferObject {
|
||||
public void delete() {
|
||||
if (handle != -1) {
|
||||
if (arb) {
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
ARBVertexBufferObject.glDeleteBuffersARB(getHandle());
|
||||
//#else
|
||||
//$$ ARBBufferObject.glDeleteBuffersARB(getHandle());
|
||||
|
||||
Reference in New Issue
Block a user