Minor mixin organization

- Move LevelRendererInstanceUpdateMixin to instancemanage package
- Ensure flywheel$ prefix is added to all mixin injector methods
This commit is contained in:
PepperCode1 2023-03-29 18:32:08 -07:00
parent 6b9b2a9927
commit a526a48d23
4 changed files with 5 additions and 5 deletions

View File

@ -10,7 +10,7 @@ import net.minecraft.client.main.Main;
@Mixin(Main.class) @Mixin(Main.class)
public class ClientMainMixin { public class ClientMainMixin {
@Inject(method = "main", at = @At("HEAD")) @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. // Only try to load RenderDoc if a system property is set.
if (System.getProperty("flw.loadRenderDoc") == null) { if (System.getProperty("flw.loadRenderDoc") == null) {
return; return;

View File

@ -55,7 +55,7 @@ public class LevelRendererMixin {
} }
@Inject(at = @At("TAIL"), method = "allChanged") @Inject(at = @At("TAIL"), method = "allChanged")
private void refresh(CallbackInfo ci) { private void flywheel$refresh(CallbackInfo ci) {
Backend.refresh(); Backend.refresh();
MinecraftForge.EVENT_BUS.post(new ReloadRenderersEvent(level)); MinecraftForge.EVENT_BUS.post(new ReloadRenderersEvent(level));

View File

@ -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.Mixin;
import org.spongepowered.asm.mixin.Shadow; 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; import net.minecraft.world.level.block.state.BlockState;
@Mixin(LevelRenderer.class) @Mixin(LevelRenderer.class)
public class LevelRendererInstanceUpdateMixin { public class InstanceUpdateMixin {
@Shadow @Shadow
private ClientLevel level; private ClientLevel level;

View File

@ -14,7 +14,6 @@
"FogUpdateMixin", "FogUpdateMixin",
"GlStateManagerMixin", "GlStateManagerMixin",
"LevelRendererAccessor", "LevelRendererAccessor",
"LevelRendererInstanceUpdateMixin",
"LevelRendererMixin", "LevelRendererMixin",
"PausedPartialTickAccessor", "PausedPartialTickAccessor",
"RenderTypeMixin", "RenderTypeMixin",
@ -22,6 +21,7 @@
"instancemanage.ChunkRebuildHooksMixin", "instancemanage.ChunkRebuildHooksMixin",
"instancemanage.InstanceAddMixin", "instancemanage.InstanceAddMixin",
"instancemanage.InstanceRemoveMixin", "instancemanage.InstanceRemoveMixin",
"instancemanage.InstanceUpdateMixin",
"light.LightUpdateMixin", "light.LightUpdateMixin",
"light.NetworkLightUpdateMixin", "light.NetworkLightUpdateMixin",
"matrix.Matrix3fAccessor", "matrix.Matrix3fAccessor",