From a526a48d235cd94620257f14f20208fba56c643a Mon Sep 17 00:00:00 2001 From: PepperCode1 <44146161+PepperCode1@users.noreply.github.com> Date: Wed, 29 Mar 2023 18:32:08 -0700 Subject: [PATCH] Minor mixin organization - Move LevelRendererInstanceUpdateMixin to instancemanage package - Ensure flywheel$ prefix is added to all mixin injector methods --- .../java/com/jozufozu/flywheel/mixin/ClientMainMixin.java | 2 +- .../java/com/jozufozu/flywheel/mixin/LevelRendererMixin.java | 2 +- .../InstanceUpdateMixin.java} | 4 ++-- src/main/resources/flywheel.mixins.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename src/main/java/com/jozufozu/flywheel/mixin/{LevelRendererInstanceUpdateMixin.java => instancemanage/InstanceUpdateMixin.java} (93%) diff --git a/src/main/java/com/jozufozu/flywheel/mixin/ClientMainMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/ClientMainMixin.java index 49f7d0abe..0b687e233 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/ClientMainMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/ClientMainMixin.java @@ -10,7 +10,7 @@ import net.minecraft.client.main.Main; @Mixin(Main.class) public class ClientMainMixin { @Inject(method = "main", at = @At("HEAD")) - private static void injectRenderDoc(CallbackInfo ci) { + private static void flywheel$injectRenderDoc(CallbackInfo ci) { // Only try to load RenderDoc if a system property is set. if (System.getProperty("flw.loadRenderDoc") == null) { return; diff --git a/src/main/java/com/jozufozu/flywheel/mixin/LevelRendererMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/LevelRendererMixin.java index b0a3b25e6..42c36b249 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/LevelRendererMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/LevelRendererMixin.java @@ -55,7 +55,7 @@ public class LevelRendererMixin { } @Inject(at = @At("TAIL"), method = "allChanged") - private void refresh(CallbackInfo ci) { + private void flywheel$refresh(CallbackInfo ci) { Backend.refresh(); MinecraftForge.EVENT_BUS.post(new ReloadRenderersEvent(level)); diff --git a/src/main/java/com/jozufozu/flywheel/mixin/LevelRendererInstanceUpdateMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/instancemanage/InstanceUpdateMixin.java similarity index 93% rename from src/main/java/com/jozufozu/flywheel/mixin/LevelRendererInstanceUpdateMixin.java rename to src/main/java/com/jozufozu/flywheel/mixin/instancemanage/InstanceUpdateMixin.java index ba3efcb6d..72bfbd5e5 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/LevelRendererInstanceUpdateMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/instancemanage/InstanceUpdateMixin.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.mixin; +package com.jozufozu.flywheel.mixin.instancemanage; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -16,7 +16,7 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; @Mixin(LevelRenderer.class) -public class LevelRendererInstanceUpdateMixin { +public class InstanceUpdateMixin { @Shadow private ClientLevel level; diff --git a/src/main/resources/flywheel.mixins.json b/src/main/resources/flywheel.mixins.json index d97661abd..849ea2f33 100644 --- a/src/main/resources/flywheel.mixins.json +++ b/src/main/resources/flywheel.mixins.json @@ -14,7 +14,6 @@ "FogUpdateMixin", "GlStateManagerMixin", "LevelRendererAccessor", - "LevelRendererInstanceUpdateMixin", "LevelRendererMixin", "PausedPartialTickAccessor", "RenderTypeMixin", @@ -22,6 +21,7 @@ "instancemanage.ChunkRebuildHooksMixin", "instancemanage.InstanceAddMixin", "instancemanage.InstanceRemoveMixin", + "instancemanage.InstanceUpdateMixin", "light.LightUpdateMixin", "light.NetworkLightUpdateMixin", "matrix.Matrix3fAccessor",