Fix some compile errors and backport stuff to Forge.
This commit is contained in:
+1
-8
@@ -11,14 +11,7 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IImmersiveP
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.world.IClientLevelWrapper;
|
||||
|
||||
import net.minecraft.client.Camera;
|
||||
import net.minecraft.client.renderer.FogRenderer;
|
||||
import net.minecraft.world.effect.MobEffects;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.level.material.FogType;
|
||||
|
||||
|
||||
import net.minecraft.client.Camera;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.world.effect.MobEffects;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
|
||||
+8
-2
@@ -38,10 +38,14 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftCli
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.misc.ILightMapWrapper;
|
||||
|
||||
#if MC_VER < MC_1_17_1
|
||||
#elif MC_VER < MC_1_21_6
|
||||
#elif MC_VER < MC_1_21_3
|
||||
import net.minecraft.client.renderer.FogRenderer;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
#elif MC_VER < MC_1_21_6
|
||||
import com.seibel.distanthorizons.coreapi.util.ColorUtil;
|
||||
import net.minecraft.client.renderer.FogRenderer;
|
||||
#else
|
||||
import com.seibel.distanthorizons.coreapi.util.ColorUtil;
|
||||
import net.minecraft.client.renderer.fog.FogData;
|
||||
import net.minecraft.client.renderer.fog.FogRenderer;
|
||||
#endif
|
||||
@@ -62,6 +66,7 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IOptifineAc
|
||||
|
||||
import net.minecraft.client.Camera;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.effect.MobEffects;
|
||||
|
||||
@@ -69,6 +74,7 @@ import net.minecraft.world.phys.Vec3;
|
||||
import com.seibel.distanthorizons.core.logging.DhLogger;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.joml.Vector4f;
|
||||
|
||||
#if MC_VER < MC_1_17_1
|
||||
import net.minecraft.tags.FluidTags;
|
||||
@@ -533,7 +539,7 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
|
||||
#else
|
||||
public void setLightmapGpuTexture(GpuTexture gpuTexture)
|
||||
{
|
||||
IClientLevelWrapper clientLevel = GetLightmapClientWrapper();
|
||||
IClientLevelWrapper clientLevel = getLightmapClientLevelWrapper();
|
||||
if (clientLevel == null)
|
||||
{
|
||||
return;
|
||||
|
||||
+1
-1
@@ -135,7 +135,7 @@ public class MixinFogRenderer
|
||||
)
|
||||
private void onSetRenderDistanceEnd(FogData instance, float value, Operation<Void> original)
|
||||
{
|
||||
if (cancelFog())
|
||||
if (MixinVanillaFogCommon.cancelFog())
|
||||
{
|
||||
instance.environmentalStart = A_REALLY_REALLY_BIG_VALUE;
|
||||
instance.environmentalEnd = A_EVEN_LARGER_VALUE;
|
||||
|
||||
+2
-27
@@ -19,10 +19,8 @@
|
||||
|
||||
package com.seibel.distanthorizons.forge.mixins.client;
|
||||
|
||||
import com.seibel.distanthorizons.common.commonMixins.MixinVanillaFogCommon;
|
||||
import com.seibel.distanthorizons.core.api.internal.ClientApi;
|
||||
import com.seibel.distanthorizons.core.config.Config;
|
||||
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftRenderWrapper;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
@@ -33,14 +31,6 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraft.client.Camera;
|
||||
import net.minecraft.client.renderer.FogRenderer;
|
||||
import net.minecraft.client.renderer.FogRenderer.FogMode;
|
||||
import net.minecraft.world.effect.MobEffects;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
#if MC_VER < MC_1_17_1
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
#else
|
||||
import net.minecraft.world.level.material.FogType;
|
||||
#endif
|
||||
|
||||
@Mixin(FogRenderer.class)
|
||||
public class MixinFogRenderer
|
||||
@@ -55,22 +45,7 @@ public class MixinFogRenderer
|
||||
remap = #if MC_VER == MC_1_17_1 || MC_VER == MC_1_18_2 false #else true #endif ) // Remap messiness due to this being weird in forge
|
||||
private static void disableSetupFog(Camera camera, FogMode fogMode, float f, boolean bl, float partTick, CallbackInfo callback)
|
||||
{
|
||||
#if MC_VER < MC_1_17_1
|
||||
FluidState fluidState = camera.getFluidInCamera();
|
||||
boolean cameraNotInFluid = fluidState.isEmpty();
|
||||
#else
|
||||
FogType fogTypes = camera.getFluidInCamera();
|
||||
boolean cameraNotInFluid = fogTypes == FogType.NONE;
|
||||
#endif
|
||||
|
||||
|
||||
Entity entity = camera.getEntity();
|
||||
boolean isSpecialFog = (entity instanceof LivingEntity) && ((LivingEntity) entity).hasEffect(MobEffects.BLINDNESS);
|
||||
if (!isSpecialFog
|
||||
&& cameraNotInFluid
|
||||
&& fogMode == FogMode.FOG_TERRAIN
|
||||
&& !SingletonInjector.INSTANCE.get(IMinecraftRenderWrapper.class).isFogStateSpecial()
|
||||
&& !Config.Client.Advanced.Graphics.Fog.enableVanillaFog.get())
|
||||
if (MixinVanillaFogCommon.cancelFog(camera, fogMode))
|
||||
{
|
||||
#if MC_VER < MC_1_17_1
|
||||
RenderSystem.fogStart(A_REALLY_REALLY_BIG_VALUE);
|
||||
|
||||
+1
-8
@@ -46,14 +46,7 @@ public class MixinLightTexture
|
||||
@Inject(method = "updateLightTexture(F)V", at = @At("RETURN"))
|
||||
public void updateLightTexture(float partialTicks, CallbackInfo ci)
|
||||
{
|
||||
IMinecraftClientWrapper mc = SingletonInjector.INSTANCE.get(IMinecraftClientWrapper.class);
|
||||
if (mc == null || mc.getWrappedClientLevel() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IClientLevelWrapper clientLevel = mc.getWrappedClientLevel();
|
||||
MinecraftRenderWrapper.INSTANCE.updateLightmap(this.lightPixels, clientLevel);
|
||||
MinecraftRenderWrapper.INSTANCE.updateLightmap(this.lightPixels);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -139,7 +139,7 @@ public class MixinFogRenderer
|
||||
)
|
||||
private void onSetRenderDistanceEnd(FogData instance, float value, Operation<Void> original)
|
||||
{
|
||||
if (cancelFog())
|
||||
if (MixinVanillaFogCommon.cancelFog())
|
||||
{
|
||||
instance.environmentalStart = A_REALLY_REALLY_BIG_VALUE;
|
||||
instance.environmentalEnd = A_EVEN_LARGER_VALUE;
|
||||
|
||||
Reference in New Issue
Block a user