From 634de3c03e14e9cd60705984e7634a7a70502dc9 Mon Sep 17 00:00:00 2001 From: Desoroxxx Date: Sat, 18 Nov 2023 00:42:02 +0100 Subject: [PATCH] Switch to `ClampUtil` --- .../java/dev/redstudio/alfheim/lighting/LightingEngine.java | 6 +++--- src/main/java/dev/redstudio/alfheim/mixin/BlockMixin.java | 4 ++-- .../alfheim/mixin/client/BlockModelRendererMixin.java | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/dev/redstudio/alfheim/lighting/LightingEngine.java b/src/main/java/dev/redstudio/alfheim/lighting/LightingEngine.java index 609c011..01f6544 100644 --- a/src/main/java/dev/redstudio/alfheim/lighting/LightingEngine.java +++ b/src/main/java/dev/redstudio/alfheim/lighting/LightingEngine.java @@ -2,7 +2,7 @@ import dev.redstudio.alfheim.api.IChunkLightingData; import dev.redstudio.alfheim.utils.PooledLongQueue; -import io.redstudioragnarok.redcore.utils.MathUtil; +import dev.redstudio.redcore.math.ClampUtil; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.profiler.Profiler; @@ -518,11 +518,11 @@ private byte getCursorLuminosity(final IBlockState state, final EnumSkyBlock lig return 0; } - return (byte) MathUtil.clampMaxFirst(LightUtil.getLightValueForState(state, world, currentPos), 0, MAX_LIGHT_LEVEL); + return (byte) ClampUtil.clampMaxFirst(LightUtil.getLightValueForState(state, world, currentPos), 0, MAX_LIGHT_LEVEL); } private byte getPosOpacity(final BlockPos blockPos, final IBlockState blockState) { - return (byte) MathUtil.clampMaxFirst(blockState.getLightOpacity(world, blockPos), 1, MAX_LIGHT_LEVEL); + return (byte) ClampUtil.clampMaxFirst(blockState.getLightOpacity(world, blockPos), 1, MAX_LIGHT_LEVEL); } private Chunk getChunk(final BlockPos blockPos) { diff --git a/src/main/java/dev/redstudio/alfheim/mixin/BlockMixin.java b/src/main/java/dev/redstudio/alfheim/mixin/BlockMixin.java index 3148f0c..79f3ca5 100644 --- a/src/main/java/dev/redstudio/alfheim/mixin/BlockMixin.java +++ b/src/main/java/dev/redstudio/alfheim/mixin/BlockMixin.java @@ -5,7 +5,7 @@ import dev.redstudio.alfheim.api.ILightInfoProvider; import dev.redstudio.alfheim.api.ILightLevelProvider; import dev.redstudio.alfheim.api.ILitBlock; -import io.redstudioragnarok.redcore.utils.MathUtil; +import dev.redstudio.redcore.math.ClampUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockLiquid; import net.minecraft.block.state.IBlockState; @@ -60,7 +60,7 @@ private static void checkForLiquid(final CallbackInfo callbackInfo, @Local(ordin @Overwrite @SideOnly(Side.CLIENT) public float getAmbientOcclusionLightValue(final IBlockState blockState) { - final byte lightValue = (byte) MathUtil.clampMinFirst(blockState.getLightValue() -1, 0, 15); + final byte lightValue = (byte) ClampUtil.clampMinFirst(blockState.getLightValue() -1, 0, 15); if (lightValue == 0) return blockState.isBlockNormalCube() ? 0.2F : 1; diff --git a/src/main/java/dev/redstudio/alfheim/mixin/client/BlockModelRendererMixin.java b/src/main/java/dev/redstudio/alfheim/mixin/client/BlockModelRendererMixin.java index d808d63..7323606 100644 --- a/src/main/java/dev/redstudio/alfheim/mixin/client/BlockModelRendererMixin.java +++ b/src/main/java/dev/redstudio/alfheim/mixin/client/BlockModelRendererMixin.java @@ -1,6 +1,6 @@ package dev.redstudio.alfheim.mixin.client; -import io.redstudioragnarok.redcore.utils.MathUtil; +import dev.redstudio.redcore.math.ClampUtil; import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.BlockModelRenderer; import net.minecraft.util.math.BlockPos; @@ -30,7 +30,7 @@ public abstract class BlockModelRendererMixin { require = 0 ) private int adjustGetLightValue(final IBlockState blockState, final IBlockAccess blockAccess, final BlockPos blockPos) { - return MathUtil.clampMinFirst(blockState.getLightValue(blockAccess, blockPos) -1, 0, 15); + return ClampUtil.clampMinFirst(blockState.getLightValue(blockAccess, blockPos) -1, 0, 15); } /** @@ -44,6 +44,6 @@ private int adjustGetLightValue(final IBlockState blockState, final IBlockAccess require = 0 ) private int adjustGetLightValueOptiFine(final IBlockState blockState, final IBlockAccess blockAccess, final BlockPos blockPos) { - return MathUtil.clampMinFirst(blockState.getLightValue(blockAccess, blockPos) -1, 0, 15); + return ClampUtil.clampMinFirst(blockState.getLightValue(blockAccess, blockPos) -1, 0, 15); } }