Move 1.7.10 code from MixinEntityRenderer to Mixin_ForceChunkLoading
This commit is contained in:
@@ -73,17 +73,6 @@ public abstract class MixinEntityRenderer implements EntityRendererHandler.IEnti
|
||||
return replayModRender_handler;
|
||||
}
|
||||
|
||||
//#if MC<=10710
|
||||
//$$ @Redirect(method = "renderWorld", at = @At(value = "INVOKE",target =
|
||||
//$$ "Lnet/minecraft/client/renderer/RenderGlobal;updateRenderers(Lnet/minecraft/entity/EntityLivingBase;Z)Z"))
|
||||
//$$ private boolean replayModRender_updateAllChunks(RenderGlobal self, EntityLivingBase view, boolean renderAllChunks) {
|
||||
//$$ if (replayModRender_handler != null) {
|
||||
//$$ renderAllChunks = true;
|
||||
//$$ }
|
||||
//$$ return self.updateRenderers(view, renderAllChunks);
|
||||
//$$ }
|
||||
//#endif
|
||||
|
||||
@Inject(method = "renderHand", at = @At("HEAD"), cancellable = true)
|
||||
private void replayModRender_renderSpectatorHand(
|
||||
//#if MC>=11500
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"Mixin_ChromaKeyDisableFog",
|
||||
"Mixin_ChromaKeyForceSky",
|
||||
"Mixin_CubicRotation",
|
||||
"Mixin_ForceChunkLoading",
|
||||
"Mixin_SkipBlockOutlinesDuringRender",
|
||||
//#if MC>=10800
|
||||
//#if MC>=11500
|
||||
@@ -16,7 +17,6 @@
|
||||
//$$ "ChunkRenderDispatcherAccessor",
|
||||
//$$ "MixinChunkRenderWorker",
|
||||
//#endif
|
||||
"Mixin_ForceChunkLoading",
|
||||
//#endif
|
||||
//#if MC>=11400
|
||||
"Mixin_PreserveDepthDuringHandRendering",
|
||||
|
||||
@@ -3,9 +3,15 @@ package com.replaymod.render.hooks;
|
||||
import net.minecraft.client.renderer.RenderGlobal;
|
||||
|
||||
public class ForceChunkLoadingHook {
|
||||
private final RenderGlobal hooked;
|
||||
|
||||
public ForceChunkLoadingHook(RenderGlobal renderGlobal) {
|
||||
this.hooked = renderGlobal;
|
||||
|
||||
IForceChunkLoading.from(renderGlobal).replayModRender_setHook(this);
|
||||
}
|
||||
|
||||
public void uninstall() {
|
||||
IForceChunkLoading.from(hooked).replayModRender_setHook(null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.replaymod.render.mixin;
|
||||
|
||||
import com.replaymod.render.hooks.ForceChunkLoadingHook;
|
||||
import com.replaymod.render.hooks.IForceChunkLoading;
|
||||
import net.minecraft.client.renderer.RenderGlobal;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||
|
||||
@Mixin(RenderGlobal.class)
|
||||
public abstract class Mixin_ForceChunkLoading implements IForceChunkLoading {
|
||||
private ForceChunkLoadingHook replayModRender_hook;
|
||||
|
||||
@Override
|
||||
public void replayModRender_setHook(ForceChunkLoadingHook hook) {
|
||||
this.replayModRender_hook = hook;
|
||||
}
|
||||
|
||||
@ModifyVariable(method = "updateRenderers", at = @At("HEAD"), argsOnly = true)
|
||||
private boolean replayModRender_updateAllChunks(boolean renderAllChunks) {
|
||||
if (replayModRender_hook != null) {
|
||||
renderAllChunks = true;
|
||||
}
|
||||
return renderAllChunks;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user