From 2b615b68bdfa57a7702246f2c58f7335bb3453bb Mon Sep 17 00:00:00 2001 From: grimmauld Date: Wed, 13 Jan 2021 09:50:00 +0100 Subject: [PATCH] Fix mixins outside dev env --- build.gradle | 6 ++++-- .../create/foundation/mixin/LightUpdateMixin.java | 3 ++- .../create/foundation/mixin/RenderInLayerMixin.java | 8 +++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index ebb0b18ad..049422317 100644 --- a/build.gradle +++ b/build.gradle @@ -37,7 +37,7 @@ minecraft { runs { client { workingDirectory project.file('run') - property 'mixin.env.disableRefMap', 'true' + // property 'mixin.env.disableRefMap', 'true' arg '-mixin.config=create.mixins.json' property 'forge.logging.console.level', 'info' property 'fml.earlyprogresswindow', 'false' @@ -50,7 +50,7 @@ minecraft { server { workingDirectory project.file('run/server') - property 'mixin.env.disableRefMap', 'true' + // property 'mixin.env.disableRefMap', 'true' arg '-mixin.config=create.mixins.json' property 'forge.logging.console.level', 'info' mods { @@ -125,6 +125,8 @@ dependencies { // i'll leave this here commented for easier testing //runtimeOnly fg.deobf("vazkii.arl:AutoRegLib:1.4-35.69") //runtimeOnly fg.deobf("vazkii.quark:Quark:r2.0-212.984") + + annotationProcessor 'org.spongepowered:mixin:0.8:processor' } jar { diff --git a/src/main/java/com/simibubi/create/foundation/mixin/LightUpdateMixin.java b/src/main/java/com/simibubi/create/foundation/mixin/LightUpdateMixin.java index 0db373baa..c19a3018b 100644 --- a/src/main/java/com/simibubi/create/foundation/mixin/LightUpdateMixin.java +++ b/src/main/java/com/simibubi/create/foundation/mixin/LightUpdateMixin.java @@ -4,13 +4,14 @@ import net.minecraft.client.multiplayer.ClientChunkProvider; import net.minecraft.util.math.SectionPos; import net.minecraft.world.LightType; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(ClientChunkProvider.class) public class LightUpdateMixin { - + @Shadow @Inject(at = @At("HEAD"), method = "markLightChanged(Lnet/minecraft/world/LightType;Lnet/minecraft/util/math/SectionPos;)V") private void onLightUpdate(LightType type, SectionPos pos, CallbackInfo ci) { diff --git a/src/main/java/com/simibubi/create/foundation/mixin/RenderInLayerMixin.java b/src/main/java/com/simibubi/create/foundation/mixin/RenderInLayerMixin.java index 9c5a2292a..b008ba822 100644 --- a/src/main/java/com/simibubi/create/foundation/mixin/RenderInLayerMixin.java +++ b/src/main/java/com/simibubi/create/foundation/mixin/RenderInLayerMixin.java @@ -1,20 +1,18 @@ package com.simibubi.create.foundation.mixin; import com.mojang.blaze3d.matrix.MatrixStack; -import net.minecraft.client.multiplayer.ClientChunkProvider; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.WorldRenderer; -import net.minecraft.util.math.SectionPos; -import net.minecraft.world.LightType; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(WorldRenderer.class) public class RenderInLayerMixin { - - @Inject(at = @At("HEAD"), method = "renderLayer") + @Shadow + @Inject(at = @At("HEAD"), method = "renderLayer") // (Lnet/minecraft/client/renderer/RenderType;Lcom/mojang/blaze3d/matrix/MatrixStack;DDD)V") private void renderLayer(RenderType type, MatrixStack stack, double cameraX, double cameraY, double cameraZ, CallbackInfo ci) { }