This commit is contained in:
Aleksey 2020-12-02 22:37:41 +03:00
commit 4eefc50385
3 changed files with 36 additions and 18 deletions

View file

@ -8,7 +8,7 @@
loader_version=0.10.8 loader_version=0.10.8
# Mod Properties # Mod Properties
mod_version = 0.7.1-beta mod_version = 0.7.2-beta
maven_group = ru.betterend maven_group = ru.betterend
archives_base_name = better-end archives_base_name = better-end

View file

@ -8,36 +8,54 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import net.minecraft.client.color.world.BiomeColors; import net.minecraft.client.color.world.BiomeColors;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockPos.Mutable; import net.minecraft.util.math.BlockPos.Mutable;
import net.minecraft.util.math.Direction;
import net.minecraft.world.BlockRenderView; import net.minecraft.world.BlockRenderView;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.BlocksHelper;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
@Mixin(BiomeColors.class) @Mixin(BiomeColors.class)
public class BiomeColorsMixin { public class BiomeColorsMixin {
private static final int POISON_COLOR = MHelper.color(92, 160, 78); private static final int POISON_COLOR = MHelper.color(92, 160, 78);
private static final int STREAM_COLOR = MHelper.color(105, 213, 244);
@Inject(method = "getWaterColor", at = @At("HEAD"), cancellable = true) @Inject(method = "getWaterColor", at = @At("RETURN"), cancellable = true)
private static void beGetWaterColor(BlockRenderView world, BlockPos pos, CallbackInfoReturnable<Integer> info) { private static void beGetWaterColor(BlockRenderView world, BlockPos pos, CallbackInfoReturnable<Integer> info) {
int x1 = pos.getX() - 1; int color = info.getReturnValue();
int y1 = pos.getY() - 1;
int z1 = pos.getZ() - 1; boolean scanDeep = true;
int x2 = pos.getX() + 2;
int y2 = pos.getY() + 2;
int z2 = pos.getZ() + 2;
Mutable mut = new Mutable(); Mutable mut = new Mutable();
for (int x = x1; x < x2; x++) { for (Direction d: BlocksHelper.HORIZONTAL) {
mut.setX(x); mut.set(pos).move(d);
for (int y = y1; y < y2; y++) { if ((world.getBlockState(mut).isOf(EndBlocks.BRIMSTONE))) {
mut.setY(y); color = POISON_COLOR;
for (int z = z1; z < z2; z++) { scanDeep = false;
break;
}
}
if (scanDeep) {
int x1 = pos.getX() - 2;
int z1 = pos.getZ() - 2;
int x2 = pos.getX() + 3;
int z2 = pos.getZ() + 3;
mut.setY(pos.getY());
for (int x = x1; x < x2 && scanDeep; x++) {
mut.setX(x);
for (int z = z1; z < z2 && scanDeep; z++) {
mut.setZ(z); mut.setZ(z);
if (world.getBlockState(mut).isOf(EndBlocks.BRIMSTONE)) { if (Math.abs(pos.getX() - x) != 2 || Math.abs(pos.getZ() - z) != 2) {
info.setReturnValue(POISON_COLOR); if ((world.getBlockState(mut).isOf(EndBlocks.BRIMSTONE))) {
info.cancel(); color = STREAM_COLOR;
return; scanDeep = false;
}
} }
} }
} }
} }
info.setReturnValue(color);
} }
} }

View file

@ -9,7 +9,7 @@ public class BiomeSulfurSprings extends EndBiome {
public BiomeSulfurSprings() { public BiomeSulfurSprings() {
super(new BiomeDefinition("sulfur_springs") super(new BiomeDefinition("sulfur_springs")
.setSurface(SurfaceBuilders.SULPHURIC_SURFACE) .setSurface(SurfaceBuilders.SULPHURIC_SURFACE)
.setWaterAndFogColor(105, 213, 244) .setWaterAndFogColor(25, 90, 157)
.setFogColor(207, 194, 62) .setFogColor(207, 194, 62)
.setFogDensity(1.5F) .setFogDensity(1.5F)
.setCaves(false) .setCaves(false)