diff --git a/build.gradle b/build.gradle index 9da492b..c479f4f 100644 --- a/build.gradle +++ b/build.gradle @@ -11,6 +11,21 @@ sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 loom { + mixin.defaultRefmapName = "mixins.replaymod.refmap.json" + forge { + mixinConfigs = [ + "mixins.compat.mapwriter.replaymod.json", + "mixins.compat.shaders.replaymod.json", + "mixins.core.replaymod.json", + "mixins.extras.playeroverview.replaymod.json", + "mixins.jgui.json", + "mixins.nonmmlauncher.replaymod.json", + "mixins.recording.replaymod.json", + "mixins.render.blend.replaymod.json", + "mixins.render.replaymod.json", + "mixins.replay.replaymod.json" + ] + } runs { it.configureEach { vmArgs("-Xmx8G", "-XX:+UseZGC") @@ -73,7 +88,7 @@ dependencies { // To change the versions see the gradle.properties file minecraft "com.mojang:minecraft:${project.minecraft_version}" //mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" - neoForge "net.neoforged:neoforge:${project.neoforge_version}" + forge "net.minecraftforge:forge:${project.minecraft_version}-${project.forge_version}" bundle("com.github.ReplayMod:ReplayStudio:d9f7c11-slim") minecraftRuntimeLibraries(implementation("com.github.ReplayMod:ReplayStudio:d9f7c11")) diff --git a/gradle.properties b/gradle.properties index f42e55f..c806f7d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,12 +3,12 @@ org.gradle.jvmargs=-Xmx3G # Fabric Properties # check these on https://modmuss50.me/fabric.html -minecraft_version=1.20.4 -yarn_mappings=1.20.4+build.1 +minecraft_version=1.20.1 +yarn_mappings=1.20.1+build.1 loader_version=0.15.0 #Fabric api -fabric_version=0.91.1+1.20.4 +fabric_version=0.91.1+1.20.1 # Mod Properties mod_version=0.1 @@ -16,5 +16,5 @@ maven_group=com.replaymod archives_base_name=replaymod # Dependencies # check this on https://modmuss50.me/fabric.html -loom.platform=neoforge -neoforge_version=20.4.234 \ No newline at end of file +loom.platform=forge +forge_version=47.1.3 \ No newline at end of file diff --git a/src/main/java/com/replaymod/recording/handler/ConnectionEventHandler.java b/src/main/java/com/replaymod/recording/handler/ConnectionEventHandler.java index b68d8fa..e09bd14 100644 --- a/src/main/java/com/replaymod/recording/handler/ConnectionEventHandler.java +++ b/src/main/java/com/replaymod/recording/handler/ConnectionEventHandler.java @@ -113,9 +113,9 @@ public void onConnectedToServerEvent(ClientConnection networkManager) { serverName = worldName; //#if MC>=11100 //#if MC>=12002 - } else if (serverInfo != null && serverInfo.isRealm()) { + //$$ } else if (serverInfo != null && serverInfo.isRealm()) { //#else - //$$ } else if (mc.isConnectedToRealms()) { + } else if (mc.isConnectedToRealms()) { //#endif // we can't access the server name without tapping too deep in the Realms Library worldName = "A Realms Server"; diff --git a/src/main/java/com/replaymod/replay/camera/CameraEntity.java b/src/main/java/com/replaymod/replay/camera/CameraEntity.java index 29524d9..98c925c 100644 --- a/src/main/java/com/replaymod/replay/camera/CameraEntity.java +++ b/src/main/java/com/replaymod/replay/camera/CameraEntity.java @@ -41,7 +41,7 @@ //#endif //#if MC>=12002 -import net.minecraft.client.util.SkinTextures; +//$$ import net.minecraft.client.util.SkinTextures; //#endif //#if MC>=11400 @@ -480,24 +480,24 @@ public boolean isInvisible() { } //#if MC>=12002 - @Override - public SkinTextures getSkinTextures() { - Entity view = this.client.getCameraEntity(); - if (view != this && view instanceof AbstractClientPlayerEntity) { - return ((AbstractClientPlayerEntity) view).getSkinTextures(); - } - return super.getSkinTextures(); - } - //#else //$$ @Override - //$$ public Identifier getSkinTexture() { + //$$ public SkinTextures getSkinTextures() { //$$ Entity view = this.client.getCameraEntity(); //$$ if (view != this && view instanceof AbstractClientPlayerEntity) { - //$$ return ((AbstractClientPlayerEntity) view).getSkinTexture(); + //$$ return ((AbstractClientPlayerEntity) view).getSkinTextures(); //$$ } - //$$ return super.getSkinTexture(); + //$$ return super.getSkinTextures(); //$$ } - //$$ + //#else + @Override + public Identifier getSkinTexture() { + Entity view = this.client.getCameraEntity(); + if (view != this && view instanceof AbstractClientPlayerEntity) { + return ((AbstractClientPlayerEntity) view).getSkinTexture(); + } + return super.getSkinTexture(); + } + //#if MC>=10800 //$$ @Override //$$ public String getModel() { diff --git a/src/main/java/de/johni0702/minecraft/gui/container/AbstractGuiOverlay.java b/src/main/java/de/johni0702/minecraft/gui/container/AbstractGuiOverlay.java index 7b8cc6e..58529bb 100644 --- a/src/main/java/de/johni0702/minecraft/gui/container/AbstractGuiOverlay.java +++ b/src/main/java/de/johni0702/minecraft/gui/container/AbstractGuiOverlay.java @@ -349,7 +349,7 @@ public boolean mouseScrolled( double mouseY, //#endif //#if MC>=12002 - double dWheelHorizontal, + //$$ double dWheelHorizontal, //#endif double dWheel ) { @@ -398,9 +398,9 @@ public void removed() { } //#if MC>=12002 - @Override - public void renderBackground(DrawContext context, int mouseX, int mouseY, float delta) { - } + //$$ @Override + //$$ public void renderBackground(DrawContext context, int mouseX, int mouseY, float delta) { + //$$ } //#endif public AbstractGuiOverlay getOverlay() { diff --git a/src/main/java/de/johni0702/minecraft/gui/container/AbstractGuiScreen.java b/src/main/java/de/johni0702/minecraft/gui/container/AbstractGuiScreen.java index 5405f8a..69649a4 100644 --- a/src/main/java/de/johni0702/minecraft/gui/container/AbstractGuiScreen.java +++ b/src/main/java/de/johni0702/minecraft/gui/container/AbstractGuiScreen.java @@ -103,9 +103,9 @@ public void draw(GuiRenderer renderer, ReadableDimension size, RenderInfo render break; case DEFAULT: //#if MC>=12002 - wrapped.renderBackground(renderer.getContext(), renderInfo.mouseX, renderInfo.mouseY, renderInfo.partialTick); + //$$ wrapped.renderBackground(renderer.getContext(), renderInfo.mouseX, renderInfo.mouseY, renderInfo.partialTick); //#elseif MC>=12000 - //$$ wrapped.renderBackground(renderer.getContext()); + wrapped.renderBackground(renderer.getContext()); //#elseif MC>=11600 //$$ wrapped.renderBackground(renderer.getMatrixStack()); //#else @@ -361,7 +361,7 @@ public boolean mouseScrolled( double mouseY, //#endif //#if MC>=12002 - double dWheelHorizontal, + //$$ double dWheelHorizontal, //#endif double dWheel ) { diff --git a/src/main/java/de/johni0702/minecraft/gui/element/AbstractGuiButton.java b/src/main/java/de/johni0702/minecraft/gui/element/AbstractGuiButton.java index cb3c432..8ffb3db 100644 --- a/src/main/java/de/johni0702/minecraft/gui/element/AbstractGuiButton.java +++ b/src/main/java/de/johni0702/minecraft/gui/element/AbstractGuiButton.java @@ -48,13 +48,13 @@ public abstract class AbstractGuiButton> extends AbstractGuiClickable implements Clickable, IGuiButton { protected static final Identifier BUTTON_SOUND = new Identifier("gui.button.press"); //#if MC>=12002 - protected static final Identifier[] BUTTON_TEXTURES = new Identifier[] { - new Identifier("widget/button_disabled"), - new Identifier("widget/button"), - new Identifier("widget/button_highlighted"), - }; + //$$ protected static final Identifier[] BUTTON_TEXTURES = new Identifier[] { + //$$ new Identifier("widget/button_disabled"), + //$$ new Identifier("widget/button"), + //$$ new Identifier("widget/button_highlighted"), + //$$ }; //#else - //$$ protected static final Identifier WIDGETS_TEXTURE = new Identifier("textures/gui/widgets.png"); + protected static final Identifier WIDGETS_TEXTURE = new Identifier("textures/gui/widgets.png"); //#endif //#if MC>=11903 @@ -107,14 +107,14 @@ public void draw(GuiRenderer renderer, ReadableDimension size, RenderInfo render int secondHalfHeight = size.getHeight() - halfHeight; //#if MC>=12002 - ReadablePoint offset = renderer.getOpenGlOffset(); - renderer.getContext().drawGuiTexture(BUTTON_TEXTURES[texture], offset.getX(), offset.getY(), size.getWidth(), size.getHeight()); + //$$ ReadablePoint offset = renderer.getOpenGlOffset(); + //$$ renderer.getContext().drawGuiTexture(BUTTON_TEXTURES[texture], offset.getX(), offset.getY(), size.getWidth(), size.getHeight()); //#else - //$$ renderer.bindTexture(WIDGETS_TEXTURE); - //$$ renderer.drawTexturedRect(0, 0, 0, textureY, halfWidth, halfHeight); - //$$ renderer.drawTexturedRect(0, halfHeight, 0, textureY + 20 - secondHalfHeight, halfWidth, secondHalfHeight); - //$$ renderer.drawTexturedRect(halfWidth, 0, 200 - secondHalfWidth, textureY, secondHalfWidth, halfHeight); - //$$ renderer.drawTexturedRect(halfWidth, halfHeight, 200 - secondHalfWidth, textureY + 20 - secondHalfHeight, secondHalfWidth, secondHalfHeight); + renderer.bindTexture(WIDGETS_TEXTURE); + renderer.drawTexturedRect(0, 0, 0, textureY, halfWidth, halfHeight); + renderer.drawTexturedRect(0, halfHeight, 0, textureY + 20 - secondHalfHeight, halfWidth, secondHalfHeight); + renderer.drawTexturedRect(halfWidth, 0, 200 - secondHalfWidth, textureY, secondHalfWidth, halfHeight); + renderer.drawTexturedRect(halfWidth, halfHeight, 200 - secondHalfWidth, textureY + 20 - secondHalfHeight, secondHalfWidth, secondHalfHeight); //#endif if (this.texture != null) { diff --git a/src/main/java/de/johni0702/minecraft/gui/element/AbstractGuiSlider.java b/src/main/java/de/johni0702/minecraft/gui/element/AbstractGuiSlider.java index 0b332b1..f973f1c 100644 --- a/src/main/java/de/johni0702/minecraft/gui/element/AbstractGuiSlider.java +++ b/src/main/java/de/johni0702/minecraft/gui/element/AbstractGuiSlider.java @@ -40,8 +40,8 @@ // TODO: Currently assumes a height of 20 public abstract class AbstractGuiSlider> extends AbstractGuiElement implements Clickable, Draggable, IGuiSlider { //#if MC>=12002 - protected static final Identifier TEXTURE = new Identifier("widget/slider"); - protected static final Identifier HANDLE_TEXTURE = new Identifier("widget/slider_handle"); + //$$ protected static final Identifier TEXTURE = new Identifier("widget/slider"); + //$$ protected static final Identifier HANDLE_TEXTURE = new Identifier("widget/slider_handle"); //#endif private Runnable onValueChanged; @@ -120,26 +120,26 @@ public void draw(GuiRenderer renderer, ReadableDimension size, RenderInfo render int height = size.getHeight(); //#if MC>=12002 - ReadablePoint offset = renderer.getOpenGlOffset(); + //$$ ReadablePoint offset = renderer.getOpenGlOffset(); //#else - //$$ renderer.bindTexture(GuiButton.WIDGETS_TEXTURE); + renderer.bindTexture(GuiButton.WIDGETS_TEXTURE); //#endif // Draw background //#if MC>=12002 - renderer.getContext().drawGuiTexture(TEXTURE, offset.getX(), offset.getY(), width, height); + //$$ renderer.getContext().drawGuiTexture(TEXTURE, offset.getX(), offset.getY(), width, height); //#else - //$$ renderer.drawTexturedRect(0, 0, 0, 46, width / 2, height); - //$$ renderer.drawTexturedRect(width / 2, 0, 200 - width / 2, 46, width / 2, height); + renderer.drawTexturedRect(0, 0, 0, 46, width / 2, height); + renderer.drawTexturedRect(width / 2, 0, 200 - width / 2, 46, width / 2, height); //#endif // Draw slider int sliderX = (width - 8) * value / steps; //#if MC>=12002 - renderer.getContext().drawGuiTexture(HANDLE_TEXTURE, offset.getX() + sliderX, offset.getY(), 8, 20); + //$$ renderer.getContext().drawGuiTexture(HANDLE_TEXTURE, offset.getX() + sliderX, offset.getY(), 8, 20); //#else - //$$ renderer.drawTexturedRect(sliderX, 0, 0, 66, 4, 20); - //$$ renderer.drawTexturedRect(sliderX + 4, 0, 196, 66, 4, 20); + renderer.drawTexturedRect(sliderX, 0, 0, 66, 4, 20); + renderer.drawTexturedRect(sliderX + 4, 0, 196, 66, 4, 20); //#endif // Draw text