diff --git a/gradle.properties b/gradle.properties index ef4fc9c0..9e95afee 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,15 +1,15 @@ # Done to increase the memory available to gradle. org.gradle.jvmargs=-Xmx1G -minecraft_version=1.14.4 -yarn_mappings=1.14.4+build.15 -loader_version=0.7.0+build.171 +minecraft_version=1.15.2 +yarn_mappings=1.15.2+build.14 +loader_version=0.7.8+build.184 -fabric_version=0.4.2+build.246-1.14 +fabric_version=0.4.32+build.292-1.15 fabric_asm_version=b97939c03a -zt_zip_version=1.13 -slf4j_version=1.7.29 +zt_zip_version=1.14 +slf4j_version=1.7.30 -mod_version = 0.7.1 +mod_version = 1.0.0-beta1 maven_group = me.modmuss50 archives_base_name = optifabric diff --git a/src/main/java/me/modmuss50/optifabric/mixin/MixinChunkCacheOF.java b/src/main/java/me/modmuss50/optifabric/mixin/MixinChunkCacheOF.java deleted file mode 100644 index 599927de..00000000 --- a/src/main/java/me/modmuss50/optifabric/mixin/MixinChunkCacheOF.java +++ /dev/null @@ -1,39 +0,0 @@ -package me.modmuss50.optifabric.mixin; - - -import net.fabricmc.fabric.impl.client.indigo.renderer.accessor.AccessChunkRendererRegion; -import net.fabricmc.fabric.impl.client.indigo.renderer.render.TerrainRenderContext; -import net.minecraft.client.render.chunk.ChunkRendererRegion; -import net.minecraft.util.math.BlockPos; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Pseudo; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -//Fabric API's indigo renderer support for optifine. This stops it from crashing, I dont really know whats going on here -@Pseudo -@Mixin(targets = "net.optifine.override.ChunkCacheOF") -public abstract class MixinChunkCacheOF implements AccessChunkRendererRegion { - private TerrainRenderContext fabric_renderer; - - //This was taken from https://github.com/FabricMC/fabric/blob/master/fabric-renderer-indigo/src/main/java/net/fabricmc/indigo/renderer/mixin/MixinChunkRenderTask.java honesly no idea what it does, but it doesnt crash the game here - @Inject(method = "", at = @At("RETURN"), remap = false) - private void constructor(ChunkRendererRegion chunkCache, BlockPos posFromIn, BlockPos posToIn, int subIn, CallbackInfo info){ - if(chunkCache != null) { - final TerrainRenderContext renderer = TerrainRenderContext.POOL.get(); - renderer.setBlockView(chunkCache); - fabric_setRenderer(renderer); - } - } - - @Override - public TerrainRenderContext fabric_getRenderer() { - return fabric_renderer; - } - - @Override - public void fabric_setRenderer(TerrainRenderContext renderer) { - fabric_renderer = renderer; - } -} diff --git a/src/main/java/me/modmuss50/optifabric/mixin/MixinTitleScreen.java b/src/main/java/me/modmuss50/optifabric/mixin/MixinTitleScreen.java index 40cb64ca..d7e0b83a 100644 --- a/src/main/java/me/modmuss50/optifabric/mixin/MixinTitleScreen.java +++ b/src/main/java/me/modmuss50/optifabric/mixin/MixinTitleScreen.java @@ -7,7 +7,7 @@ import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.TitleScreen; import net.minecraft.text.Text; -import net.minecraft.util.SystemUtil; +import net.minecraft.util.Util; import net.minecraft.util.math.MathHelper; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; @@ -38,7 +38,7 @@ private void init(CallbackInfo info) { @Inject(method = "render", at = @At("RETURN")) private void render(int int_1, int int_2, float float_1, CallbackInfo info) { if (!OptifabricError.hasError()) { - float fadeTime = this.doBackgroundFade ? (float) (SystemUtil.getMeasuringTimeMs() - this.backgroundFadeStart) / 1000.0F : 1.0F; + float fadeTime = this.doBackgroundFade ? (float) (Util.getMeasuringTimeMs() - this.backgroundFadeStart) / 1000.0F : 1.0F; float fadeColor = this.doBackgroundFade ? MathHelper.clamp(fadeTime - 1.0F, 0.0F, 1.0F) : 1.0F; int int_6 = MathHelper.ceil(fadeColor * 255.0F) << 24; diff --git a/src/main/java/me/modmuss50/optifabric/mod/Optifabric.java b/src/main/java/me/modmuss50/optifabric/mod/Optifabric.java index c37bc011..7789940e 100644 --- a/src/main/java/me/modmuss50/optifabric/mod/Optifabric.java +++ b/src/main/java/me/modmuss50/optifabric/mod/Optifabric.java @@ -5,7 +5,7 @@ import net.minecraft.client.gui.screen.ConfirmScreen; import net.minecraft.text.LiteralText; import net.minecraft.util.Formatting; -import net.minecraft.util.SystemUtil; +import net.minecraft.util.Util; public class Optifabric implements ModInitializer { @@ -13,7 +13,7 @@ public static void checkForErrors() { if (OptifabricError.hasError()) { ConfirmScreen confirmScreen = new ConfirmScreen(t -> { if (t) { - SystemUtil.getOperatingSystem().open(OptifabricError.getErrorURL()); + Util.getOperatingSystem().open(OptifabricError.getErrorURL()); } else { MinecraftClient.getInstance().scheduleStop(); } diff --git a/src/main/java/me/modmuss50/optifabric/mod/OptifineSetup.java b/src/main/java/me/modmuss50/optifabric/mod/OptifineSetup.java index 2f4a0618..85482305 100644 --- a/src/main/java/me/modmuss50/optifabric/mod/OptifineSetup.java +++ b/src/main/java/me/modmuss50/optifabric/mod/OptifineSetup.java @@ -178,9 +178,10 @@ IMappingProvider createMappings(String from, String to) { File fullMappings = extractMappings(); return (out) -> { RemapUtils.getTinyRemapper(fullMappings, from, to).load(out); - out.acceptField(new IMappingProvider.Member("cyf", "CLOUDS", "Lcxt;"), + //TODO use the mappings API here to stop neededing to change this each version + out.acceptField(new IMappingProvider.Member("dbq", "CLOUDS", "Ldbe;"), "CLOUDS_OF"); - out.acceptField(new IMappingProvider.Member("dng", "renderDistance", "I"), + out.acceptField(new IMappingProvider.Member("dqr", "renderDistance", "I"), "renderDistance_OF"); }; } catch (Exception e) { diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index e3a51c49..12f7db65 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -25,12 +25,13 @@ ] }, "custom": { - "fabric-renderer-indigo:force_compatibility" : true, + "fabric-renderer-api-v1:contains_renderer" : true, "mm:early_risers": [ "me.modmuss50.optifabric.mod.OptifabricSetup" ] }, "depends": { - "fabricloader": ">=0.4.0" + "fabricloader": ">=0.7.8", + "minecraft": ">=1.15.2" } } diff --git a/src/main/resources/optifabric.indigofix.mixins.json b/src/main/resources/optifabric.indigofix.mixins.json index aa718825..10539dff 100644 --- a/src/main/resources/optifabric.indigofix.mixins.json +++ b/src/main/resources/optifabric.indigofix.mixins.json @@ -3,7 +3,6 @@ "package": "me.modmuss50.optifabric.mixin", "compatibilityLevel": "JAVA_8", "mixins": [ - "MixinChunkCacheOF" ], "injectors": { "defaultRequire": 1