Extract Mixin_ChromaKeyDisableFog from other mixins
This commit is contained in:
@@ -84,17 +84,6 @@ public abstract class MixinEntityRenderer implements EntityRendererHandler.IEnti
|
|||||||
//$$ }
|
//$$ }
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
// Moved to MixinFogRenderer in 1.13
|
|
||||||
//#if MC<11400
|
|
||||||
//$$ @Inject(method = "setupFog", at = @At("HEAD"), cancellable = true)
|
|
||||||
//$$ private void replayModRender_onSetupFog(int fogDistanceFlag, float partialTicks, CallbackInfo ci) {
|
|
||||||
//$$ if (replayModRender_handler == null) return;
|
|
||||||
//$$ if (replayModRender_handler.getSettings().getChromaKeyingColor() != null) {
|
|
||||||
//$$ ci.cancel();
|
|
||||||
//$$ }
|
|
||||||
//$$ }
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
@Inject(method = "renderHand", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "renderHand", at = @At("HEAD"), cancellable = true)
|
||||||
private void replayModRender_renderSpectatorHand(
|
private void replayModRender_renderSpectatorHand(
|
||||||
//#if MC>=11500
|
//#if MC>=11500
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
//#if MC>=11400
|
|
||||||
package com.replaymod.render.mixin;
|
package com.replaymod.render.mixin;
|
||||||
|
|
||||||
import com.replaymod.core.versions.MCVer;
|
import com.replaymod.core.versions.MCVer;
|
||||||
@@ -9,12 +8,8 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
//#if MC>=11400
|
|
||||||
import net.minecraft.client.render.Camera;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
@Mixin(BackgroundRenderer.class)
|
@Mixin(BackgroundRenderer.class)
|
||||||
public abstract class MixinFogRenderer {
|
public abstract class Mixin_ChromaKeyDisableFog {
|
||||||
@Inject(method = "applyFog", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "applyFog", at = @At("HEAD"), cancellable = true)
|
||||||
private
|
private
|
||||||
//#if MC>=11500
|
//#if MC>=11500
|
||||||
@@ -29,4 +24,3 @@ public abstract class MixinFogRenderer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//#endif
|
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
"server": [],
|
"server": [],
|
||||||
"client": [
|
"client": [
|
||||||
"Mixin_ChromaKeyColorSky",
|
"Mixin_ChromaKeyColorSky",
|
||||||
|
"Mixin_ChromaKeyDisableFog",
|
||||||
"Mixin_ChromaKeyForceSky",
|
"Mixin_ChromaKeyForceSky",
|
||||||
"Mixin_CubicRotation",
|
"Mixin_CubicRotation",
|
||||||
"Mixin_SkipBlockOutlinesDuringRender",
|
"Mixin_SkipBlockOutlinesDuringRender",
|
||||||
@@ -31,9 +32,6 @@
|
|||||||
//#endif
|
//#endif
|
||||||
"MixinCamera",
|
"MixinCamera",
|
||||||
"MixinEntityRenderer",
|
"MixinEntityRenderer",
|
||||||
//#if MC>=11400
|
|
||||||
"MixinFogRenderer",
|
|
||||||
//#endif
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
"MixinGlStateManager",
|
"MixinGlStateManager",
|
||||||
//#endif
|
//#endif
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.replaymod.render.mixin;
|
||||||
|
|
||||||
|
import com.replaymod.render.hooks.EntityRendererHandler;
|
||||||
|
import net.minecraft.client.renderer.EntityRenderer;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(EntityRenderer.class)
|
||||||
|
public abstract class Mixin_ChromaKeyDisableFog implements EntityRendererHandler.IEntityRenderer {
|
||||||
|
@Inject(method = "setupFog", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void replayModRender_onSetupFog(int fogDistanceFlag, float partialTicks, CallbackInfo ci) {
|
||||||
|
EntityRendererHandler handler = replayModRender_getHandler();
|
||||||
|
if (handler != null && handler.getSettings().getChromaKeyingColor() != null) {
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user