Port to MC 1.20
This commit is contained in:
@@ -252,6 +252,7 @@ dependencies {
|
||||
11902: '1.19.2',
|
||||
11903: '1.19.3-rc3',
|
||||
11904: '1.19.4',
|
||||
12000: '1.20',
|
||||
][mcVersion]
|
||||
mappings 'net.fabricmc:yarn:' + [
|
||||
11404: '1.14.4+build.16',
|
||||
@@ -268,6 +269,7 @@ dependencies {
|
||||
11902: '1.19.2+build.28:v2',
|
||||
11903: '1.19.3-rc3+build.1:v2',
|
||||
11904: '1.19.4+build.1:v2',
|
||||
12000: '1.20+build.1:v2',
|
||||
][mcVersion]
|
||||
modImplementation 'net.fabricmc:fabric-loader:0.14.11'
|
||||
def fabricApiVersion = [
|
||||
@@ -285,6 +287,7 @@ dependencies {
|
||||
11902: '0.68.0+1.19.2',
|
||||
11903: '0.68.1+1.19.3',
|
||||
11904: '0.76.0+1.19.4',
|
||||
12000: '0.83.0+1.20',
|
||||
][mcVersion]
|
||||
def fabricApiModules = [
|
||||
"api-base",
|
||||
@@ -365,7 +368,7 @@ dependencies {
|
||||
|
||||
shadow 'com.github.ReplayMod.JavaBlend:2.79.0:a0696f8'
|
||||
|
||||
shadow "com.github.ReplayMod:ReplayStudio:d3f8506", shadeExclusions
|
||||
shadow "com.github.ReplayMod:ReplayStudio:a1e2b83", shadeExclusions
|
||||
|
||||
// FIXME this should be pulled in by ReplayStudio, and IntelliJ sees it, but javac for some reason does not
|
||||
implementation 'com.github.viaversion:opennbt:0a02214' // 2.0-SNAPSHOT (ViaVersion Edition)
|
||||
@@ -376,7 +379,9 @@ dependencies {
|
||||
shadow 'com.github.ReplayMod:lwjgl-utils:27dcd66'
|
||||
|
||||
if (FABRIC) {
|
||||
if (mcVersion >= 11904) {
|
||||
if (mcVersion >= 12000) {
|
||||
modImplementation 'com.terraformersmc:modmenu:7.0.1'
|
||||
} else if (mcVersion >= 11904) {
|
||||
modImplementation 'com.terraformersmc:modmenu:6.1.0-rc.4'
|
||||
} else if (mcVersion >= 11903) {
|
||||
modImplementation 'com.terraformersmc:modmenu:5.0.0-alpha.4'
|
||||
|
||||
2
jGui
2
jGui
Submodule jGui updated: 05f8ac3ed5...7d002840c4
@@ -193,6 +193,7 @@ val doRelease by tasks.registering {
|
||||
defaultTasks("bundleJar")
|
||||
|
||||
preprocess {
|
||||
val mc12000 = createNode("1.20", 12000, "yarn")
|
||||
val mc11904 = createNode("1.19.4", 11904, "yarn")
|
||||
val mc11903 = createNode("1.19.3", 11903, "yarn")
|
||||
val mc11902 = createNode("1.19.2", 11902, "yarn")
|
||||
@@ -217,6 +218,7 @@ preprocess {
|
||||
val mc10800 = createNode("1.8", 10800, "srg")
|
||||
val mc10710 = createNode("1.7.10", 10710, "srg")
|
||||
|
||||
mc12000.link(mc11904)
|
||||
mc11904.link(mc11903)
|
||||
mc11903.link(mc11902, file("versions/mapping-fabric-1.19.3-1.19.2.txt"))
|
||||
mc11902.link(mc11901)
|
||||
|
||||
@@ -37,6 +37,7 @@ val jGuiVersions = listOf(
|
||||
"1.19.2",
|
||||
"1.19.3",
|
||||
"1.19.4",
|
||||
"1.20",
|
||||
)
|
||||
val replayModVersions = listOf(
|
||||
// "1.7.10",
|
||||
@@ -62,6 +63,7 @@ val replayModVersions = listOf(
|
||||
"1.19.2",
|
||||
"1.19.3",
|
||||
"1.19.4",
|
||||
"1.20",
|
||||
)
|
||||
|
||||
rootProject.buildFileName = "root.gradle.kts"
|
||||
|
||||
@@ -897,4 +897,13 @@ class Patterns {
|
||||
//#else
|
||||
//$$ @Pattern private static void REGISTRIES() {}
|
||||
//#endif
|
||||
|
||||
@Pattern
|
||||
public World getWorld(Entity entity) {
|
||||
//#if MC>=12000
|
||||
//$$ return entity.getWorld();
|
||||
//#else
|
||||
return entity.world;
|
||||
//#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,12 +9,17 @@ import de.johni0702.minecraft.gui.versions.callbacks.RenderHudCallback;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.font.TextRenderer;
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
|
||||
import static com.replaymod.core.ReplayMod.TEXTURE;
|
||||
import static com.replaymod.core.ReplayMod.TEXTURE_SIZE;
|
||||
import static com.mojang.blaze3d.platform.GlStateManager.*;
|
||||
|
||||
//#if MC>=12000
|
||||
//$$ import net.minecraft.client.gui.DrawContext;
|
||||
//#else
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
//#endif
|
||||
|
||||
/**
|
||||
* Renders overlay during recording.
|
||||
*/
|
||||
@@ -33,7 +38,11 @@ public class GuiRecordingOverlay extends EventRegistrations {
|
||||
* Render the recording icon and text in the top left corner of the screen.
|
||||
*/
|
||||
{ on(RenderHudCallback.EVENT, (stack, partialTicks) -> renderRecordingIndicator(stack)); }
|
||||
//#if MC>=12000
|
||||
//$$ private void renderRecordingIndicator(DrawContext stack) {
|
||||
//#else
|
||||
private void renderRecordingIndicator(MatrixStack stack) {
|
||||
//#endif
|
||||
if (guiControls.isStopped()) return;
|
||||
if (settingsRegistry.get(Setting.INDICATOR)) {
|
||||
TextRenderer fontRenderer = mc.textRenderer;
|
||||
|
||||
@@ -27,6 +27,9 @@ import net.minecraft.client.render.WorldRenderer;
|
||||
public abstract class Mixin_ChromaKeyForceSky {
|
||||
@Shadow @Final private MinecraftClient client;
|
||||
|
||||
//#if MC>=11700
|
||||
//$$ // Sky appears to be rendered unconditionally now
|
||||
//#else
|
||||
//#if MC>=11500
|
||||
@ModifyConstant(method = "render", constant = @Constant(intValue = 4))
|
||||
//#elseif MC>=11400
|
||||
@@ -44,4 +47,5 @@ public abstract class Mixin_ChromaKeyForceSky {
|
||||
}
|
||||
return value;
|
||||
}
|
||||
//#endif
|
||||
}
|
||||
|
||||
@@ -41,6 +41,11 @@ import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.client.render.RenderTickCounter;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
//#if MC>=12000
|
||||
//$$ import com.mojang.blaze3d.systems.VertexSorter;
|
||||
//$$ import net.minecraft.client.gui.DrawContext;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11700
|
||||
//$$ import net.minecraft.client.render.DiffuseLighting;
|
||||
//$$ import net.minecraft.util.math.Matrix4f;
|
||||
@@ -492,7 +497,11 @@ public class VideoRenderer implements RenderInfo {
|
||||
//$$ (float) (window.getFramebufferHeight() / window.getScaleFactor()),
|
||||
//$$ 1000,
|
||||
//$$ 3000
|
||||
//$$ ));
|
||||
//$$ )
|
||||
//#if MC>=12000
|
||||
//$$ , VertexSorter.BY_Z
|
||||
//#endif
|
||||
//$$ );
|
||||
//$$ MatrixStack matrixStack = RenderSystem.getModelViewStack();
|
||||
//$$ matrixStack.loadIdentity();
|
||||
//$$ matrixStack.translate(0, 0, -2000);
|
||||
@@ -544,7 +553,9 @@ public class VideoRenderer implements RenderInfo {
|
||||
try {
|
||||
mc.currentScreen = gui.toMinecraft();
|
||||
mc.getOverlay().render(
|
||||
//#if MC>=11600
|
||||
//#if MC>=12000
|
||||
//$$ new DrawContext(mc, mc.getBufferBuilders().getEntityVertexConsumers()),
|
||||
//#elseif MC>=11600
|
||||
new MatrixStack(),
|
||||
//#endif
|
||||
mouseX, mouseY, 0);
|
||||
@@ -554,7 +565,9 @@ public class VideoRenderer implements RenderInfo {
|
||||
} else {
|
||||
gui.toMinecraft().tick();
|
||||
gui.toMinecraft().render(
|
||||
//#if MC>=11600
|
||||
//#if MC>=12000
|
||||
//$$ new DrawContext(mc, mc.getBufferBuilders().getEntityVertexConsumers()),
|
||||
//#elseif MC>=11600
|
||||
new MatrixStack(),
|
||||
//#endif
|
||||
mouseX, mouseY, 0);
|
||||
|
||||
@@ -440,7 +440,11 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
||||
//#endif
|
||||
LightingProvider provider = world.getChunkManager().getLightingProvider();
|
||||
while (provider.hasUpdates()) {
|
||||
//#if MC>=12000
|
||||
//$$ provider.doLightUpdates();
|
||||
//#else
|
||||
provider.doLightUpdates(Integer.MAX_VALUE, true, true);
|
||||
//#endif
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -712,6 +716,9 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
||||
//#if MC>=11900
|
||||
//$$ , java.util.Optional.empty()
|
||||
//#endif
|
||||
//#if MC>=12000
|
||||
//$$ , packet.portalCooldown()
|
||||
//#endif
|
||||
);
|
||||
//#else
|
||||
//#if MC>=10800
|
||||
@@ -775,6 +782,9 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
||||
//#if MC>=11900
|
||||
//$$ , java.util.Optional.empty()
|
||||
//#endif
|
||||
//#if MC>=12000
|
||||
//$$ , respawn.getPortalCooldown()
|
||||
//#endif
|
||||
);
|
||||
//#else
|
||||
//#if MC>=10809
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.replaymod.core.utils.WrappedTimer;
|
||||
import com.replaymod.core.versions.MCVer;
|
||||
import com.replaymod.replay.camera.CameraController;
|
||||
import com.replaymod.replay.camera.CameraEntity;
|
||||
import de.johni0702.minecraft.gui.versions.ScreenExt;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.render.RenderTickCounter;
|
||||
|
||||
@@ -78,7 +79,7 @@ public class InputReplayTimer extends WrappedTimer {
|
||||
// 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>=11400
|
||||
if (mc.currentScreen == null || mc.currentScreen.passEvents) {
|
||||
if (mc.currentScreen == null || ((ScreenExt) mc.currentScreen).doesPassEvents()) {
|
||||
GLFW.glfwPollEvents();
|
||||
MCVer.processKeyBinds();
|
||||
}
|
||||
|
||||
@@ -42,6 +42,11 @@ import net.minecraft.network.ClientConnection;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
//#if MC>=12000
|
||||
//$$ import com.mojang.blaze3d.systems.VertexSorter;
|
||||
//$$ import net.minecraft.client.gui.DrawContext;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11904
|
||||
//$$ import net.minecraft.network.PacketBundler;
|
||||
//#endif
|
||||
@@ -653,7 +658,11 @@ public class ReplayHandler {
|
||||
//$$ (float) (window.getFramebufferHeight() / window.getScaleFactor()),
|
||||
//$$ 1000,
|
||||
//$$ 3000
|
||||
//$$ ));
|
||||
//$$ )
|
||||
//#if MC>=12000
|
||||
//$$ , VertexSorter.BY_Z
|
||||
//#endif
|
||||
//$$ );
|
||||
//$$ MatrixStack matrixStack = RenderSystem.getModelViewStack();
|
||||
//$$ matrixStack.loadIdentity();
|
||||
//$$ matrixStack.translate(0, 0, -2000);
|
||||
@@ -676,7 +685,9 @@ public class ReplayHandler {
|
||||
//#endif
|
||||
|
||||
guiScreen.toMinecraft().init(mc, window.getScaledWidth(), window.getScaledHeight());
|
||||
//#if MC>=11600
|
||||
//#if MC>=12000
|
||||
//$$ guiScreen.toMinecraft().render(new DrawContext(mc, mc.getBufferBuilders().getEntityVertexConsumers()), 0, 0, 0);
|
||||
//#elseif MC>=11600
|
||||
guiScreen.toMinecraft().render(new MatrixStack(), 0, 0, 0);
|
||||
//#else
|
||||
//#if MC>=11400
|
||||
|
||||
@@ -332,7 +332,12 @@ public class CameraEntity
|
||||
public void afterSpawn() {
|
||||
// Make sure our world is up-to-date in case of world changes
|
||||
if (this.client.world != null) {
|
||||
// FIXME cannot use Patters because `setWorld` is `protected` in 1.20
|
||||
//#if MC>=12000
|
||||
//$$ this.setWorld(this.client.world);
|
||||
//#else
|
||||
this.world = this.client.world;
|
||||
//#endif
|
||||
}
|
||||
super.afterSpawn();
|
||||
}
|
||||
|
||||
@@ -16,6 +16,10 @@ import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.widget.AbstractButtonWidget;
|
||||
|
||||
//#if MC>=12000
|
||||
//$$ import net.minecraft.client.gui.DrawContext;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11904
|
||||
//#else
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
@@ -316,7 +320,10 @@ public class GuiHandler extends EventRegistrations {
|
||||
this::onButton
|
||||
) {
|
||||
@Override
|
||||
//#if MC>=11904
|
||||
//#if MC>=12000
|
||||
//$$ public void renderButton(DrawContext context, int mouseX, int mouseY, float delta) {
|
||||
//$$ super.renderButton(context, mouseX, mouseY, delta);
|
||||
//#elseif MC>=11904
|
||||
//$$ public void renderButton(MatrixStack context, int mouseX, int mouseY, float delta) {
|
||||
//$$ super.renderButton(context, mouseX, mouseY, delta);
|
||||
//#else
|
||||
|
||||
@@ -30,6 +30,7 @@ public class LoadingPlugin implements IFMLLoadingPlugin {
|
||||
MixinBootstrap.init();
|
||||
}
|
||||
|
||||
Mixins.addConfiguration("mixins.jgui.json");
|
||||
Mixins.addConfiguration("mixins.core.replaymod.json");
|
||||
Mixins.addConfiguration("mixins.recording.replaymod.json");
|
||||
Mixins.addConfiguration("mixins.render.replaymod.json");
|
||||
|
||||
Reference in New Issue
Block a user