diff --git a/common/src/main/java/com/jozufozu/flywheel/impl/mixin/LevelRendererMixin.java b/common/src/main/java/com/jozufozu/flywheel/impl/mixin/LevelRendererMixin.java index 993c0dffb..2840cd3aa 100644 --- a/common/src/main/java/com/jozufozu/flywheel/impl/mixin/LevelRendererMixin.java +++ b/common/src/main/java/com/jozufozu/flywheel/impl/mixin/LevelRendererMixin.java @@ -102,7 +102,7 @@ abstract class LevelRendererMixin { flywheel$dispatch(RenderStage.AFTER_TRANSLUCENT_TERRAIN); } - @Inject(method = "renderLevel", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/LevelRenderer;renderChunkLayer(Lnet/minecraft/client/renderer/RenderType;Lcom/mojang/blaze3d/vertex/PoseStack;DDDLorg/joml/Matrix4f;)V", ordinal = 6, shift = Shift.AFTER)) + @Inject(method = "renderLevel", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/LevelRenderer;renderSectionLayer(Lnet/minecraft/client/renderer/RenderType;Lcom/mojang/blaze3d/vertex/PoseStack;DDDLorg/joml/Matrix4f;)V", ordinal = 6, shift = Shift.AFTER)) private void flywheel$onStage$afterTranslucentTerrain(CallbackInfo ci) { flywheel$dispatch(RenderStage.AFTER_TRANSLUCENT_TERRAIN); } @@ -113,6 +113,7 @@ abstract class LevelRendererMixin { flywheel$dispatch(RenderStage.AFTER_PARTICLES); } + //fixme take a look over if this is still needed @Group(name = "onStage$afterParticles") @Inject(method = "renderLevel", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/particle/ParticleEngine;render(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource$BufferSource;Lnet/minecraft/client/renderer/LightTexture;Lnet/minecraft/client/Camera;FLnet/minecraft/client/renderer/culling/Frustum;)V", shift = Shift.AFTER)) private void flywheel$onStage$afterParticles$forge(CallbackInfo ci) { diff --git a/common/src/main/java/com/jozufozu/flywheel/impl/mixin/visualmanage/RebuildTaskMixin.java b/common/src/main/java/com/jozufozu/flywheel/impl/mixin/visualmanage/RebuildTaskMixin.java index 7b55a0279..9a77c0d8c 100644 --- a/common/src/main/java/com/jozufozu/flywheel/impl/mixin/visualmanage/RebuildTaskMixin.java +++ b/common/src/main/java/com/jozufozu/flywheel/impl/mixin/visualmanage/RebuildTaskMixin.java @@ -10,9 +10,9 @@ import net.minecraft.world.level.block.entity.BlockEntity; -@Mixin(targets = "net.minecraft.client.renderer.chunk.ChunkRenderDispatcher$RenderChunk$RebuildTask") +@Mixin(targets = "net.minecraft.client.renderer.chunk.SectionRenderDispatcher$RenderSection$RebuildTask") abstract class RebuildTaskMixin { - @Inject(method = "handleBlockEntity(Lnet/minecraft/client/renderer/chunk/ChunkRenderDispatcher$RenderChunk$RebuildTask$CompileResults;Lnet/minecraft/world/level/block/entity/BlockEntity;)V", at = @At("HEAD"), cancellable = true) + @Inject(method = "handleBlockEntity(Lnet/minecraft/client/renderer/chunk/SectionRenderDispatcher$RenderSection$RebuildTask$CompileResults;Lnet/minecraft/world/level/block/entity/BlockEntity;)V", at = @At("HEAD"), cancellable = true) private void flywheel$tryAddBlockEntity(@Coerce Object compileResults, BlockEntity blockEntity, CallbackInfo ci) { if (VisualizationHelper.tryAddBlockEntity(blockEntity)) { ci.cancel(); diff --git a/forge/src/main/java/com/jozufozu/flywheel/impl/FlywheelForge.java b/forge/src/main/java/com/jozufozu/flywheel/impl/FlywheelForge.java index afc38687a..8fadd30f8 100644 --- a/forge/src/main/java/com/jozufozu/flywheel/impl/FlywheelForge.java +++ b/forge/src/main/java/com/jozufozu/flywheel/impl/FlywheelForge.java @@ -101,7 +101,7 @@ private static void registerImplEventListeners(IEventBus forgeEventBus, IEventBu modEventBus.addListener((FMLLoadCompleteEvent e) -> FlywheelInit.freezeRegistries()); - modEventBus.addListener((EndClientResourceReloadEvent e) -> BackendManagerImpl.onEndClientResourceReload(e.error().isPresent())); + modEventBus.addListener((EndClientResourceReloadEvent e) -> BackendManagerImpl.onEndClientResourceReload(e.error() != null)); modEventBus.addListener((FMLCommonSetupEvent e) -> { ArgumentTypeInfos.registerByClass(BackendArgument.class, BackendArgument.INFO); diff --git a/forge/src/main/java/com/jozufozu/flywheel/impl/mixin/MinecraftMixin.java b/forge/src/main/java/com/jozufozu/flywheel/impl/mixin/MinecraftMixin.java index 17c92f315..8db0f2558 100644 --- a/forge/src/main/java/com/jozufozu/flywheel/impl/mixin/MinecraftMixin.java +++ b/forge/src/main/java/com/jozufozu/flywheel/impl/mixin/MinecraftMixin.java @@ -9,30 +9,28 @@ 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.Coerce; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import com.jozufozu.flywheel.api.event.EndClientResourceReloadEvent; -import com.mojang.realmsclient.client.RealmsClient; import net.minecraft.client.Minecraft; -import net.minecraft.client.main.GameConfig; -import net.minecraft.server.packs.resources.ReloadInstance; import net.minecraft.server.packs.resources.ReloadableResourceManager; -@Mixin(Minecraft.class) +@Mixin(value = Minecraft.class, remap = false) abstract class MinecraftMixin { @Shadow @Final private ReloadableResourceManager resourceManager; - @Inject(method = "lambda$new$5", at = @At("HEAD")) - private void flywheel$onEndInitialResourceReload(RealmsClient realmsClient, ReloadInstance reloadInstance, GameConfig gameConfig, Optional error, CallbackInfo ci) { + @Inject(method = "lambda$new$7", at = @At("HEAD")) + private void flywheel$onEndInitialResourceReload(@Coerce Object minecraft$gameloadcookie, Optional error, CallbackInfo ci) { ModLoader.get().postEvent(new EndClientResourceReloadEvent((Minecraft) (Object) this, resourceManager, true, error)); } - @Inject(method = "lambda$reloadResourcePacks$28", at = @At("HEAD")) - private void flywheel$onEndManualResourceReload(boolean recovery, CompletableFuture future, Optional error, CallbackInfo ci) { + @Inject(method = "lambda$reloadResourcePacks$39", at = @At("HEAD")) + private void flywheel$onEndManualResourceReload(boolean bl, @Coerce Object minecraft$gameloadcookie, CompletableFuture completablefuture, Optional error, CallbackInfo ci) { ModLoader.get().postEvent(new EndClientResourceReloadEvent((Minecraft) (Object) this, resourceManager, false, error)); } } diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml index 4164edde6..546372adf 100644 --- a/forge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -23,13 +23,13 @@ config = "flywheel.impl.sodium.mixins.json" [[dependencies.${mod_id}]] modId = "minecraft" -mandatory = true +type = "required" versionRange = "${minecraft_maven_version_range}" side = "CLIENT" [[dependencies.${mod_id}]] modId = "neoforge" -mandatory = true +type = "required" versionRange = "${neoforge_version_range}" side = "CLIENT"