[Change] Removed old Sodium compatibility Code (#317)

This commit is contained in:
Frank 2023-12-19 22:05:23 +01:00
parent bb601d9246
commit c95e5eac06

View file

@ -27,18 +27,16 @@ public class BiomeColorsMixin {
private static final int POISON_COLOR = ColorUtil.color(92, 160, 78); private static final int POISON_COLOR = ColorUtil.color(92, 160, 78);
private static final int STREAM_COLOR = ColorUtil.color(105, 213, 244); private static final int STREAM_COLOR = ColorUtil.color(105, 213, 244);
private static final Point[] OFFSETS; private static final Point[] OFFSETS;
private static final boolean HAS_SODIUM;
@Inject(method = "getAverageWaterColor", at = @At("RETURN"), cancellable = true) @Inject(method = "getAverageWaterColor", at = @At("RETURN"), cancellable = true)
private static void be_getWaterColor(BlockAndTintGetter world, BlockPos pos, CallbackInfoReturnable<Integer> info) { private static void be_getWaterColor(BlockAndTintGetter world, BlockPos pos, CallbackInfoReturnable<Integer> info) {
if (ClientOptions.useSulfurWaterColor()) { if (ClientOptions.useSulfurWaterColor()) {
BlockAndTintGetter view = HAS_SODIUM ? Minecraft.getInstance().level : world;
MutableBlockPos mut = new MutableBlockPos(); MutableBlockPos mut = new MutableBlockPos();
mut.setY(pos.getY()); mut.setY(pos.getY());
for (int i = 0; i < OFFSETS.length; i++) { for (int i = 0; i < OFFSETS.length; i++) {
mut.setX(pos.getX() + OFFSETS[i].x); mut.setX(pos.getX() + OFFSETS[i].x);
mut.setZ(pos.getZ() + OFFSETS[i].y); mut.setZ(pos.getZ() + OFFSETS[i].y);
if ((view.getBlockState(mut).is(EndBlocks.BRIMSTONE))) { if ((world.getBlockState(mut).is(EndBlocks.BRIMSTONE))) {
info.setReturnValue(i < 4 ? POISON_COLOR : STREAM_COLOR); info.setReturnValue(i < 4 ? POISON_COLOR : STREAM_COLOR);
return; return;
} }
@ -47,8 +45,6 @@ public class BiomeColorsMixin {
} }
static { static {
HAS_SODIUM = FabricLoader.getInstance().isModLoaded("sodium");
int index = 0; int index = 0;
OFFSETS = new Point[20]; OFFSETS = new Point[20];
for (int x = -2; x < 3; x++) { for (int x = -2; x < 3; x++) {