Update to 1.21.11 (#1106)
Co-authored-by: Jonas Herzig <me@johni0702.de>
This commit is contained in:
@@ -92,6 +92,7 @@ dependencies {
|
||||
12105 -> "0.119.9+1.21.5"
|
||||
12107 -> "0.128.1+1.21.7"
|
||||
12110 -> "0.135.0+1.21.10"
|
||||
12111 -> "0.139.5+1.21.11"
|
||||
else -> throw UnsupportedOperationException()
|
||||
}
|
||||
val fabricApiModules = mutableListOf(
|
||||
@@ -170,6 +171,7 @@ dependencies {
|
||||
|
||||
if (platform.isFabric) {
|
||||
val modMenuVersion = when {
|
||||
mcVersion >= 12111 -> "17.0.0-alpha.1"
|
||||
mcVersion >= 12110 -> "16.0.0-rc.1"
|
||||
mcVersion >= 12107 -> "15.0.0-beta.3"
|
||||
mcVersion >= 12105 -> "14.0.0-rc.2"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
essential.defaults.loom=0
|
||||
essential.defaults.loom.fabric-loader=net.fabricmc:fabric-loader:0.17.3
|
||||
essential.defaults.loom.fabric-loader=net.fabricmc:fabric-loader:0.18.2
|
||||
|
||||
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
|
||||
# This is required to provide enough memory for the Minecraft decompilation process.
|
||||
|
||||
2
jGui
2
jGui
Submodule jGui updated: 84a8c5438d...985836c3d0
Submodule libs/ReplayStudio updated: 03d5609f77...526f9aaf43
@@ -204,6 +204,7 @@ defaultTasks("bundleJar")
|
||||
preprocess {
|
||||
strictExtraMappings.set(true)
|
||||
|
||||
val mc12111 = createNode("1.21.11", 12111, "yarn")
|
||||
val mc12110 = createNode("1.21.10", 12110, "yarn")
|
||||
val mc12107 = createNode("1.21.7", 12107, "yarn")
|
||||
val mc12105 = createNode("1.21.5", 12105, "yarn")
|
||||
@@ -238,6 +239,7 @@ preprocess {
|
||||
val mc10800 = createNode("1.8", 10800, "srg")
|
||||
val mc10710 = createNode("1.7.10", 10710, "srg")
|
||||
|
||||
mc12111.link(mc12110, file("versions/mapping-fabric-1.21.11-1.21.10.txt"))
|
||||
mc12110.link(mc12107, file("versions/mapping-fabric-1.21.10-1.21.7.txt"))
|
||||
mc12107.link(mc12105)
|
||||
mc12105.link(mc12104, file("versions/mapping-fabric-1.21.5-1.21.4.txt"))
|
||||
|
||||
@@ -45,6 +45,7 @@ val jGuiVersions = listOf(
|
||||
"1.21.5",
|
||||
"1.21.7",
|
||||
"1.21.10",
|
||||
"1.21.11",
|
||||
)
|
||||
val replayModVersions = listOf(
|
||||
// "1.7.10",
|
||||
@@ -80,6 +81,7 @@ val replayModVersions = listOf(
|
||||
"1.21.5",
|
||||
"1.21.7",
|
||||
"1.21.10",
|
||||
"1.21.11",
|
||||
)
|
||||
|
||||
rootProject.buildFileName = "root.gradle.kts"
|
||||
|
||||
@@ -70,7 +70,6 @@ import static com.replaymod.core.versions.MCVer.getMinecraft;
|
||||
|
||||
//#if MC>=12109
|
||||
//$$ import com.replaymod.core.versions.MCVer.Keyboard;
|
||||
//$$ import net.minecraft.client.input.SystemKeycodes;
|
||||
//#endif
|
||||
|
||||
//#if MC>=12100
|
||||
@@ -235,7 +234,7 @@ public class Utils {
|
||||
|
||||
public static boolean isCtrlDown() {
|
||||
//#if MC>=12109
|
||||
//$$ return Keyboard.isKeyDown(SystemKeycodes.LEFT_CTRL) || Keyboard.isKeyDown(SystemKeycodes.RIGHT_CTRL);
|
||||
//$$ return Keyboard.isKeyDown(Keyboard.LEFT_CTRL) || Keyboard.isKeyDown(Keyboard.RIGHT_CTRL);
|
||||
//#elseif MC>=11400
|
||||
return Screen.hasControlDown();
|
||||
//#else
|
||||
|
||||
@@ -15,6 +15,7 @@ import net.minecraft.network.NetworkState;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
//#if MC>=12105
|
||||
//$$ import net.minecraft.client.render.VertexConsumer;
|
||||
@@ -447,18 +448,21 @@ public class MCVer {
|
||||
//#endif
|
||||
|
||||
//#if MC>=12105
|
||||
//$$ public static void emitLine(MatrixStack matrixStack, VertexConsumer buffer, Vector2f p1, Vector2f p2, int color) {
|
||||
//$$ public static void emitLine(MatrixStack matrixStack, VertexConsumer buffer, Vector2f p1, Vector2f p2, int color, float lineWidth) {
|
||||
//#else
|
||||
public static void emitLine(MatrixStack matrixStack, BufferBuilder buffer, Vector2f p1, Vector2f p2, int color) {
|
||||
public static void emitLine(MatrixStack matrixStack, BufferBuilder buffer, Vector2f p1, Vector2f p2, int color, float lineWidth) {
|
||||
//#endif
|
||||
emitLine(matrixStack, buffer, new Vector3f(p1.x, p1.y, 0), new Vector3f(p2.x, p2.y, 0), color);
|
||||
emitLine(matrixStack, buffer, new Vector3f(p1.x, p1.y, 0), new Vector3f(p2.x, p2.y, 0), color, lineWidth);
|
||||
}
|
||||
|
||||
//#if MC>=12105
|
||||
//$$ public static void emitLine(MatrixStack matrixStack, VertexConsumer buffer, Vector3f p1, Vector3f p2, int color) {
|
||||
//$$ public static void emitLine(MatrixStack matrixStack, VertexConsumer buffer, Vector3f p1, Vector3f p2, int color, float lineWidth) {
|
||||
//#else
|
||||
public static void emitLine(MatrixStack matrixStack, BufferBuilder buffer, Vector3f p1, Vector3f p2, int color) {
|
||||
public static void emitLine(MatrixStack matrixStack, BufferBuilder buffer, Vector3f p1, Vector3f p2, int color, float lineWidth) {
|
||||
//#endif
|
||||
//#if MC<12111
|
||||
GL11.glLineWidth(lineWidth);
|
||||
//#endif
|
||||
int r = color >> 24 & 0xff;
|
||||
int g = color >> 16 & 0xff;
|
||||
int b = color >> 8 & 0xff;
|
||||
@@ -471,6 +475,9 @@ public class MCVer {
|
||||
//#else
|
||||
//$$ buffer.vertex(p1.x, p1.y, p1.z)
|
||||
//#endif
|
||||
//#if MC>=12111
|
||||
//$$ .lineWidth(lineWidth)
|
||||
//#endif
|
||||
.color(r, g, b, a)
|
||||
//#if MC>=11700
|
||||
//$$ .normal(n.x, n.y, n.z)
|
||||
@@ -482,6 +489,9 @@ public class MCVer {
|
||||
//#else
|
||||
//$$ buffer.vertex(p2.x, p2.y, p2.z)
|
||||
//#endif
|
||||
//#if MC>=12111
|
||||
//$$ .lineWidth(lineWidth)
|
||||
//#endif
|
||||
.color(r, g, b, a)
|
||||
//#if MC>=11700
|
||||
//$$ .normal(n.x, n.y, n.z)
|
||||
@@ -539,6 +549,11 @@ public class MCVer {
|
||||
public static abstract class Keyboard {
|
||||
//#if MC>=11400
|
||||
public static final int KEY_LCONTROL = GLFW.GLFW_KEY_LEFT_CONTROL;
|
||||
public static final int KEY_RCONTROL = GLFW.GLFW_KEY_RIGHT_CONTROL;
|
||||
public static final int KEY_LSUPER = GLFW.GLFW_KEY_LEFT_SUPER;
|
||||
public static final int KEY_RSUPER = GLFW.GLFW_KEY_RIGHT_SUPER;
|
||||
public static final int LEFT_CTRL = Util.getOperatingSystem() == Util.OperatingSystem.OSX ? KEY_LSUPER : KEY_LCONTROL;
|
||||
public static final int RIGHT_CTRL = Util.getOperatingSystem() == Util.OperatingSystem.OSX ? KEY_RSUPER : KEY_RCONTROL;
|
||||
public static final int KEY_LSHIFT = GLFW.GLFW_KEY_LEFT_SHIFT;
|
||||
public static final int KEY_ESCAPE = GLFW.GLFW_KEY_ESCAPE;
|
||||
public static final int KEY_HOME = GLFW.GLFW_KEY_HOME;
|
||||
|
||||
@@ -578,7 +578,9 @@ class Patterns {
|
||||
|
||||
@Pattern
|
||||
private static void GL11_glLineWidth(float width) {
|
||||
//#if MC>=11700
|
||||
//#if MC>=12111
|
||||
//$$ // Got removed in 1.21.11. Use lineWidth on VertexConsumer instead.
|
||||
//#elseif MC>=11700
|
||||
//$$ com.mojang.blaze3d.systems.RenderSystem.lineWidth(width);
|
||||
//#else
|
||||
GL11.glLineWidth(width);
|
||||
|
||||
@@ -139,7 +139,10 @@ public class Util {
|
||||
//#if MC>=10800
|
||||
public static Vector3f getCameraPos() {
|
||||
MinecraftClient mc = MinecraftClient.getInstance();
|
||||
//#if MC>=11400
|
||||
//#if MC>=12111
|
||||
//$$ Vec3d pos = mc.getEntityRenderDispatcher().camera.getCameraPos();
|
||||
//$$ return new Vector3f((float) pos.x, (float) pos.y, (float) pos.z);
|
||||
//#elseif MC>=11400
|
||||
Vec3d pos = mc.getEntityRenderDispatcher().camera.getPos();
|
||||
return new Vector3f((float) pos.x, (float) pos.y, (float) pos.z);
|
||||
//#else
|
||||
|
||||
@@ -134,7 +134,11 @@ public class VirtualWindow implements Closeable {
|
||||
|
||||
applyScaleFactor();
|
||||
if (mc.currentScreen != null) {
|
||||
//#if MC>=12111
|
||||
//$$ mc.currentScreen.resize(window.getScaledWidth(), window.getScaledHeight());
|
||||
//#else
|
||||
mc.currentScreen.resize(mc, window.getScaledWidth(), window.getScaledHeight());
|
||||
//#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,11 @@ import de.johni0702.minecraft.gui.utils.EventRegistrations;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
|
||||
//#if MC>=12111
|
||||
//$$ import net.minecraft.client.render.CameraOverride;
|
||||
//$$ import org.joml.Vector3f;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11400
|
||||
import com.replaymod.core.events.PostRenderCallback;
|
||||
import com.replaymod.core.events.PreRenderCallback;
|
||||
@@ -98,7 +103,9 @@ public class EntityRendererHandler extends EventRegistrations implements WorldRe
|
||||
mc.options.pauseOnLostFocus = false; // do not want the pause menu to open if the window is unfocused
|
||||
if (omnidirectional) {
|
||||
// makes no sense, we wouldn't even know where to put it
|
||||
//#if MC>=12106
|
||||
//#if MC>=12111
|
||||
//$$ mc.gameRenderer.setCameraOverride(new CameraOverride(new Vector3f(mc.gameRenderer.getCamera().getHorizontalPlane())));
|
||||
//#elseif MC>=12106
|
||||
//$$ mc.gameRenderer.setRenderingPanorama(false);
|
||||
//#else
|
||||
gameRenderer.setRenderHand(false);
|
||||
@@ -120,7 +127,9 @@ public class EntityRendererHandler extends EventRegistrations implements WorldRe
|
||||
} finally {
|
||||
mc.currentScreen = orgScreen;
|
||||
mc.options.pauseOnLostFocus = orgPauseOnLostFocus;
|
||||
//#if MC>=12106
|
||||
//#if MC>=12111
|
||||
//$$ mc.gameRenderer.setCameraOverride(null);
|
||||
//#elseif MC>=12106
|
||||
//$$ mc.gameRenderer.setRenderingPanorama(orgRenderHand);
|
||||
//#else
|
||||
gameRenderer.setRenderHand(orgRenderHand);
|
||||
|
||||
@@ -18,8 +18,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
*/
|
||||
@Mixin(WorldRenderer.class)
|
||||
public abstract class Mixin_ChromaKeyColorSky {
|
||||
@Shadow @Final private MinecraftClient client;
|
||||
|
||||
//#if MC>=11800
|
||||
//$$ @Inject(
|
||||
//#if MC>=12102
|
||||
@@ -44,14 +42,17 @@ public abstract class Mixin_ChromaKeyColorSky {
|
||||
//#else
|
||||
//$$ @Inject(method = "renderSky(FI)V", at = @At("HEAD"), cancellable = true)
|
||||
//#endif
|
||||
//#if MC>=12111
|
||||
//$$ static
|
||||
//#endif
|
||||
private void chromaKeyingSky(CallbackInfo ci) {
|
||||
EntityRendererHandler handler = ((EntityRendererHandler.IEntityRenderer) this.client.gameRenderer).replayModRender_getHandler();
|
||||
EntityRendererHandler handler = ((EntityRendererHandler.IEntityRenderer) MinecraftClient.getInstance().gameRenderer).replayModRender_getHandler();
|
||||
if (handler != null) {
|
||||
ReadableColor color = handler.getSettings().getChromaKeyingColor();
|
||||
if (color != null) {
|
||||
//#if MC>=12105
|
||||
//$$ RenderSystem.getDevice().createCommandEncoder().clearColorTexture(
|
||||
//$$ this.client.getFramebuffer().getColorAttachment(),
|
||||
//$$ MinecraftClient.getInstance().getFramebuffer().getColorAttachment(),
|
||||
//$$ (0xff << 24) | (color.getRed() << 16) | (color.getGreen() << 8) | color.getBlue()
|
||||
//$$ );
|
||||
//#else
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.replaymod.render.hooks.EntityRendererHandler;
|
||||
import com.replaymod.replay.camera.CameraEntity;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.world.World;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
@@ -46,7 +47,11 @@ public abstract class Mixin_StabilizeCamera {
|
||||
//#endif
|
||||
private void replayModRender_beforeSetupCameraTransform(
|
||||
//#if MC>=11400
|
||||
//#if MC>=12111
|
||||
//$$ World blockView,
|
||||
//#else
|
||||
BlockView blockView,
|
||||
//#endif
|
||||
Entity entity,
|
||||
boolean thirdPerson,
|
||||
boolean inverseView,
|
||||
@@ -106,7 +111,11 @@ public abstract class Mixin_StabilizeCamera {
|
||||
//#endif
|
||||
private void replayModRender_afterSetupCameraTransform(
|
||||
//#if MC>=11400
|
||||
//#if MC>=12111
|
||||
//$$ World blockView,
|
||||
//#else
|
||||
BlockView blockView,
|
||||
//#endif
|
||||
Entity entity,
|
||||
boolean thirdPerson,
|
||||
boolean inverseView,
|
||||
|
||||
@@ -394,7 +394,11 @@ public class VideoRenderer implements RenderInfo {
|
||||
cameraPathExporter.setup(totalFrames);
|
||||
}
|
||||
|
||||
//#if MC>=12111
|
||||
//$$ gui.toMinecraft().init(mc.getWindow().getScaledWidth(), mc.getWindow().getScaledHeight());
|
||||
//#else
|
||||
gui.toMinecraft().init(mc, mc.getWindow().getScaledWidth(), mc.getWindow().getScaledHeight());
|
||||
//#endif
|
||||
|
||||
forceChunkLoadingHook = new ForceChunkLoadingHook(mc.worldRenderer);
|
||||
}
|
||||
@@ -599,7 +603,11 @@ public class VideoRenderer implements RenderInfo {
|
||||
//#endif
|
||||
//#endif
|
||||
|
||||
//#if MC>=12111
|
||||
//$$ gui.toMinecraft().init(window.getScaledWidth(), window.getScaledHeight());
|
||||
//#else
|
||||
gui.toMinecraft().init(mc, window.getScaledWidth(), window.getScaledHeight());
|
||||
//#endif
|
||||
|
||||
// Events are polled on 1.13+ in mainWindow.update which is called later
|
||||
//#if MC<11400
|
||||
@@ -624,7 +632,11 @@ public class VideoRenderer implements RenderInfo {
|
||||
//$$ GameRendererAccessor gameRenderer = (GameRendererAccessor) mc.gameRenderer;
|
||||
//$$ GuiRenderState guiRenderState = gameRenderer.getGuiState();
|
||||
//$$ guiRenderState.clear();
|
||||
//#if MC>=12111
|
||||
//$$ DrawContext drawContext = new DrawContext(mc, guiRenderState, mouseX, mouseY);
|
||||
//#else
|
||||
//$$ DrawContext drawContext = new DrawContext(mc, guiRenderState);
|
||||
//#endif
|
||||
//#elseif MC>=12000
|
||||
//$$ DrawContext drawContext = new DrawContext(mc, mc.getBufferBuilders().getEntityVertexConsumers());
|
||||
//#endif
|
||||
|
||||
@@ -810,12 +810,22 @@ public class ReplayHandler {
|
||||
//#endif
|
||||
//#endif
|
||||
|
||||
guiScreen.toMinecraft().init(mc, window.getScaledWidth(), window.getScaledHeight());
|
||||
//#if MC>=12111
|
||||
//$$ guiScreen.toMinecraft().init(window.getScaledWidth(), window.getScaledHeight());
|
||||
//#else
|
||||
//$$ guiScreen.toMinecraft().init(mc, window.getScaledWidth(), window.getScaledHeight());
|
||||
//#endif
|
||||
//#if MC>=12106
|
||||
//$$ GameRendererAccessor gameRenderer = (GameRendererAccessor) mc.gameRenderer;
|
||||
//$$ GuiRenderState guiRenderState = gameRenderer.getGuiState();
|
||||
//$$ guiRenderState.clear();
|
||||
//#if MC>=12111
|
||||
//$$ int mouseX = (int) mc.mouse.getX() * window.getScaledWidth() / Math.max(window.getWidth(), 1);
|
||||
//$$ int mouseY = (int) mc.mouse.getY() * window.getScaledHeight() / Math.max(window.getHeight(), 1);
|
||||
//$$ guiScreen.toMinecraft().renderWithTooltip(new DrawContext(mc, guiRenderState, mouseX, mouseY), 0, 0, 0);
|
||||
//#else
|
||||
//$$ guiScreen.toMinecraft().renderWithTooltip(new DrawContext(mc, guiRenderState), 0, 0, 0);
|
||||
//#endif
|
||||
//$$ var orgFog = RenderSystem.getShaderFog();
|
||||
//$$ var orgProjBuf = RenderSystem.getProjectionMatrixBuffer();
|
||||
//$$ var orgProjType = RenderSystem.getProjectionType();
|
||||
|
||||
@@ -320,7 +320,10 @@ public class GuiHandler extends EventRegistrations {
|
||||
this::onButton
|
||||
) {
|
||||
@Override
|
||||
//#if MC>=12000
|
||||
//#if MC>=12111
|
||||
//$$ public void drawIcon(DrawContext context, int mouseX, int mouseY, float delta) {
|
||||
//$$ super.drawIcon(context, mouseX, mouseY, delta);
|
||||
//#elseif MC>=12000
|
||||
//$$ public void renderButton(DrawContext context, int mouseX, int mouseY, float delta) {
|
||||
//$$ super.renderButton(context, mouseX, mouseY, delta);
|
||||
//#elseif MC>=11904
|
||||
@@ -544,7 +547,9 @@ public class GuiHandler extends EventRegistrations {
|
||||
}
|
||||
|
||||
public static class InjectedButton extends
|
||||
//#if MC>=11400
|
||||
//#if MC>=12111
|
||||
//$$ ButtonWidget.Text
|
||||
//#elseif MC>=11400
|
||||
ButtonWidget
|
||||
//#else
|
||||
//$$ GuiButton
|
||||
@@ -596,7 +601,7 @@ public class GuiHandler extends EventRegistrations {
|
||||
|
||||
//#if MC>=11903
|
||||
//$$ if (tooltip != null) {
|
||||
//$$ setTooltip(Tooltip.of(Text.translatable(tooltip)));
|
||||
//$$ setTooltip(Tooltip.of(net.minecraft.text.Text.translatable(tooltip)));
|
||||
//$$ }
|
||||
//#endif
|
||||
}
|
||||
|
||||
@@ -12,14 +12,18 @@ import net.minecraft.util.Util;
|
||||
//$$ import net.minecraft.client.Minecraft;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11500
|
||||
//#if MC>=12111
|
||||
//$$ @Mixin(net.minecraft.client.render.TextureTransform.class)
|
||||
//#elseif MC>=11500
|
||||
@Mixin(net.minecraft.client.render.RenderPhase.class)
|
||||
//#else
|
||||
//$$ @Mixin(net.minecraft.client.render.item.ItemRenderer.class)
|
||||
//#endif
|
||||
public class MixinRenderItem {
|
||||
//#if MC>=11400
|
||||
//#if MC>=11500
|
||||
//#if MC>=12111
|
||||
//$$ @Redirect(method = "getGlintTransformation", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Util;getMeasuringTimeMs()J"))
|
||||
//#elseif MC>=11500
|
||||
@Redirect(method = "setupGlintTexturing", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Util;getMeasuringTimeMs()J"))
|
||||
//#else
|
||||
//#if MC>=11400
|
||||
|
||||
@@ -38,6 +38,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>=12111
|
||||
//$$ import net.minecraft.client.render.RenderLayers;
|
||||
//#endif
|
||||
|
||||
//#if MC>=12106
|
||||
//$$ import com.replaymod.replay.mixin.DrawContextAccessor;
|
||||
//$$ import com.replaymod.render.mixin.GameRendererAccessor;
|
||||
@@ -186,10 +190,15 @@ public class GuiKeyframeTimeline extends AbstractGuiTimeline<GuiKeyframeTimeline
|
||||
float positionXKeyframeTimeline = positonX + KEYFRAME_SIZE / 2f;
|
||||
|
||||
final int color = 0xff0000ff;
|
||||
final float lineWidth = 2f;
|
||||
//#if MC>=12105
|
||||
//$$ VertexConsumerProvider.Immediate immediate = getMinecraft().getBufferBuilders().getEntityVertexConsumers();
|
||||
//$$ immediate.draw();
|
||||
//#if MC>=12111
|
||||
//$$ VertexConsumer buffer = immediate.getBuffer(RenderLayers.LINES);
|
||||
//#else
|
||||
//$$ VertexConsumer buffer = immediate.getBuffer(RenderLayer.LINE_STRIP);
|
||||
//#endif
|
||||
//#else
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
//#if MC>=12100
|
||||
@@ -211,18 +220,18 @@ public class GuiKeyframeTimeline extends AbstractGuiTimeline<GuiKeyframeTimeline
|
||||
|
||||
//#if MC>=12106
|
||||
//$$ linesRenderState.color = color;
|
||||
//$$ linesRenderState.lineWidth = lineWidth;
|
||||
//$$ linesRenderState.line(p1, p2);
|
||||
//$$ linesRenderState.line(p2, p3);
|
||||
//$$ linesRenderState.line(p3, p4);
|
||||
//#else
|
||||
MatrixStack matrixStack = renderer.getMatrixStack();
|
||||
emitLine(matrixStack, buffer, p1, p2, color);
|
||||
emitLine(matrixStack, buffer, p2, p3, color);
|
||||
emitLine(matrixStack, buffer, p3, p4, color);
|
||||
emitLine(matrixStack, buffer, p1, p2, color, lineWidth);
|
||||
emitLine(matrixStack, buffer, p2, p3, color, lineWidth);
|
||||
emitLine(matrixStack, buffer, p3, p4, color, lineWidth);
|
||||
|
||||
pushScissorState();
|
||||
setScissorDisabled();
|
||||
GL11.glLineWidth(2);
|
||||
|
||||
//#if MC>=12105
|
||||
//$$ immediate.draw();
|
||||
@@ -303,6 +312,7 @@ public class GuiKeyframeTimeline extends AbstractGuiTimeline<GuiKeyframeTimeline
|
||||
//$$
|
||||
//$$ List<Pair<Vector2f, Vector2f>> lines = new ArrayList<>();
|
||||
//$$ int color;
|
||||
//$$ float lineWidth;
|
||||
//$$
|
||||
//$$ public void line(Vector2f p1, Vector2f p2) {
|
||||
//$$ lines.add(Pair.of(p1, p2));
|
||||
@@ -342,9 +352,12 @@ public class GuiKeyframeTimeline extends AbstractGuiTimeline<GuiKeyframeTimeline
|
||||
//$$ @Override
|
||||
//$$ protected void render(TimeTimelineLinesRenderState state, MatrixStack matrixStack) {
|
||||
//$$ matrixStack.translate(-state.x2 / 2f, -state.y2, 100);
|
||||
//$$ RenderSystem.lineWidth(2);
|
||||
//$$ for (Pair<Vector2f, Vector2f> line : state.lines) {
|
||||
//$$ emitLine(matrixStack, vertexConsumers.getBuffer(RenderLayer.LINES), line.getLeft(), line.getRight(), state.color);
|
||||
//#if MC>=12111
|
||||
//$$ emitLine(matrixStack, vertexConsumers.getBuffer(RenderLayers.LINES), line.getLeft(), line.getRight(), state.color, state.lineWidth);
|
||||
//#else
|
||||
//$$ emitLine(matrixStack, vertexConsumers.getBuffer(RenderLayer.LINES), line.getLeft(), line.getRight(), state.color, state.lineWidth);
|
||||
//#endif
|
||||
//$$ }
|
||||
//$$ }
|
||||
//$$
|
||||
|
||||
@@ -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>=12111
|
||||
//$$ import net.minecraft.client.render.RenderLayers;
|
||||
//#endif
|
||||
|
||||
//#if MC>=12105
|
||||
//$$ import net.minecraft.client.render.RenderLayer;
|
||||
//$$ import net.minecraft.client.render.VertexConsumer;
|
||||
@@ -270,7 +274,11 @@ public class PathPreviewRenderer extends EventRegistrations {
|
||||
//#if MC>=12105
|
||||
//$$ VertexConsumerProvider.Immediate immediate = mc.getBufferBuilders().getEntityVertexConsumers();
|
||||
//$$ immediate.draw();
|
||||
//#if MC>=12111
|
||||
//$$ VertexConsumer buffer = immediate.getBuffer(RenderLayers.LINES);
|
||||
//#else
|
||||
//$$ VertexConsumer buffer = immediate.getBuffer(RenderLayer.LINES);
|
||||
//#endif
|
||||
//#else
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
//#if MC>=12100
|
||||
@@ -281,9 +289,7 @@ public class PathPreviewRenderer extends EventRegistrations {
|
||||
//#endif
|
||||
//#endif
|
||||
|
||||
emitLine(new MatrixStack(), buffer, Vector3f.sub(pos1, view, null), Vector3f.sub(pos2, view, null), color);
|
||||
|
||||
GL11.glLineWidth(3);
|
||||
emitLine(new MatrixStack(), buffer, Vector3f.sub(pos1, view, null), Vector3f.sub(pos2, view, null), color, 3f);
|
||||
|
||||
//#if MC>=12105
|
||||
//$$ immediate.draw();
|
||||
@@ -335,7 +341,9 @@ public class PathPreviewRenderer extends EventRegistrations {
|
||||
//#if MC>=12105
|
||||
//$$ VertexConsumerProvider.Immediate immediate = mc.getBufferBuilders().getEntityVertexConsumers();
|
||||
//$$ immediate.draw();
|
||||
//#if MC>=12106
|
||||
//#if MC>=12111
|
||||
//$$ VertexConsumer buffer = immediate.getBuffer(RenderLayers.textSeeThrough(TEXTURE));
|
||||
//#elseif MC>=12106
|
||||
//$$ VertexConsumer buffer = immediate.getBuffer(RenderLayer.getTextSeeThrough(TEXTURE));
|
||||
//#else
|
||||
//$$ VertexConsumer buffer = immediate.getBuffer(RenderLayer.getGuiTexturedOverlay(TEXTURE));
|
||||
@@ -401,7 +409,11 @@ public class PathPreviewRenderer extends EventRegistrations {
|
||||
//#if MC>=12105
|
||||
//$$ VertexConsumerProvider.Immediate immediate = mc.getBufferBuilders().getEntityVertexConsumers();
|
||||
//$$ immediate.draw();
|
||||
//#if MC>=12111
|
||||
//$$ VertexConsumer buffer = immediate.getBuffer(RenderLayers.LINES);
|
||||
//#else
|
||||
//$$ VertexConsumer buffer = immediate.getBuffer(RenderLayer.LINES);
|
||||
//#endif
|
||||
//#else
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
//#if MC>=12100
|
||||
@@ -412,7 +424,7 @@ public class PathPreviewRenderer extends EventRegistrations {
|
||||
//#endif
|
||||
//#endif
|
||||
|
||||
emitLine(new MatrixStack(), buffer, new Vector3f(0, 0, 0), new Vector3f(0, 0, 2), 0x00ff00aa);
|
||||
emitLine(new MatrixStack(), buffer, new Vector3f(0, 0, 0), new Vector3f(0, 0, 2), 0x00ff00aa, 3f);
|
||||
|
||||
//#if MC>=12105
|
||||
//$$ immediate.draw();
|
||||
@@ -445,7 +457,9 @@ public class PathPreviewRenderer extends EventRegistrations {
|
||||
|
||||
float r = -cubeSize/2;
|
||||
|
||||
//#if MC>=12106
|
||||
//#if MC>=12111
|
||||
//$$ buffer = immediate.getBuffer(RenderLayers.text(CAMERA_HEAD));
|
||||
//#elseif MC>=12106
|
||||
//$$ buffer = immediate.getBuffer(RenderLayer.getText(CAMERA_HEAD));
|
||||
//#elseif MC>=12105
|
||||
//$$ buffer = immediate.getBuffer(RenderLayer.getGuiTextured(CAMERA_HEAD));
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.replaymod.replaystudio.protocol.packets.PacketEnabledPacksData;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import net.minecraft.client.network.ClientConfigurationNetworkHandler;
|
||||
import net.minecraft.nbt.NbtElement;
|
||||
import net.minecraft.nbt.NbtOps;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.network.listener.ClientConfigurationPacketListener;
|
||||
@@ -24,6 +25,7 @@ import net.minecraft.registry.DynamicRegistryManager;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.registry.RegistryOps;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
@@ -43,8 +45,9 @@ public abstract class MixinNetHandlerConfigClient {
|
||||
ByteBuf byteBuf = Unpooled.buffer();
|
||||
PacketByteBuf buf = new PacketByteBuf(byteBuf);
|
||||
buf.writeString(PacketEnabledPacksData.ID);
|
||||
RegistryOps<NbtElement> ops = registryManager.getOps(NbtOps.INSTANCE);
|
||||
buf.writeVarInt(1);
|
||||
write(buf, registryManager.get(RegistryKeys.DIMENSION_TYPE), DimensionType.CODEC);
|
||||
write(buf, registryManager.get(RegistryKeys.DIMENSION_TYPE), DimensionType.CODEC, ops);
|
||||
|
||||
byte[] bytes = new byte[byteBuf.readableBytes()];
|
||||
byteBuf.readBytes(bytes);
|
||||
@@ -59,12 +62,12 @@ public abstract class MixinNetHandlerConfigClient {
|
||||
}
|
||||
|
||||
@Unique
|
||||
private <T> void write(PacketByteBuf buf, Registry<T> registry, Codec<T> codec) {
|
||||
private <T> void write(PacketByteBuf buf, Registry<T> registry, Codec<T> codec, RegistryOps<NbtElement> ops) {
|
||||
buf.writeString(registry.getKey().getValue().toString());
|
||||
buf.writeVarInt(registry.size());
|
||||
for (Map.Entry<RegistryKey<T>, T> entry : registry.getEntrySet()) {
|
||||
buf.writeString(entry.getKey().getValue().toString());
|
||||
buf.writeNbt(codec.encodeStart(NbtOps.INSTANCE, entry.getValue()).getOrThrow());
|
||||
buf.writeNbt(codec.encodeStart(ops, entry.getValue()).getOrThrow());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
0
versions/1.21.11/.gitkeep
Normal file
0
versions/1.21.11/.gitkeep
Normal file
3
versions/1.21.11/gradle.properties
Normal file
3
versions/1.21.11/gradle.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
essential.defaults.loom.minecraft=com.mojang:minecraft:1.21.11
|
||||
essential.defaults.loom.mappings=net.fabricmc:yarn:1.21.11+build.3
|
||||
essential.loom.disableUnpick=true
|
||||
@@ -12,7 +12,11 @@ import org.spongepowered.asm.mixin.injection.At;
|
||||
@Mixin(GlResourceManager.class)
|
||||
public class Mixin_FixCopyTextureToBuffer_DepthTexture {
|
||||
@WrapOperation(
|
||||
//#if MC>=12111
|
||||
//$$ method = "copyTextureToBuffer(Lcom/mojang/blaze3d/textures/GpuTexture;Lcom/mojang/blaze3d/buffers/GpuBuffer;JLjava/lang/Runnable;IIIII)V",
|
||||
//#else
|
||||
method = "copyTextureToBuffer(Lcom/mojang/blaze3d/textures/GpuTexture;Lcom/mojang/blaze3d/buffers/GpuBuffer;ILjava/lang/Runnable;IIIII)V",
|
||||
//#endif
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gl/FramebufferManager;setupFramebuffer(IIIII)V")
|
||||
)
|
||||
private void setupFramebuffer(
|
||||
|
||||
1
versions/mapping-fabric-1.21.11-1.21.10.txt
Normal file
1
versions/mapping-fabric-1.21.11-1.21.10.txt
Normal file
@@ -0,0 +1 @@
|
||||
net.minecraft.client.render.Camera getCameraPos() getPos()
|
||||
Reference in New Issue
Block a user