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
# Mod Properties
mod_version = 0.7.1-beta
mod_version = 0.7.2-beta
maven_group = ru.betterend
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.util.math.BlockPos;
import net.minecraft.util.math.BlockPos.Mutable;
import net.minecraft.util.math.Direction;
import net.minecraft.world.BlockRenderView;
import ru.betterend.registry.EndBlocks;
import ru.betterend.util.BlocksHelper;
import ru.betterend.util.MHelper;
@Mixin(BiomeColors.class)
public class BiomeColorsMixin {
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) {
int x1 = pos.getX() - 1;
int y1 = pos.getY() - 1;
int z1 = pos.getZ() - 1;
int x2 = pos.getX() + 2;
int y2 = pos.getY() + 2;
int z2 = pos.getZ() + 2;
int color = info.getReturnValue();
boolean scanDeep = true;
Mutable mut = new Mutable();
for (int x = x1; x < x2; x++) {
mut.setX(x);
for (int y = y1; y < y2; y++) {
mut.setY(y);
for (int z = z1; z < z2; z++) {
for (Direction d: BlocksHelper.HORIZONTAL) {
mut.set(pos).move(d);
if ((world.getBlockState(mut).isOf(EndBlocks.BRIMSTONE))) {
color = POISON_COLOR;
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);
if (world.getBlockState(mut).isOf(EndBlocks.BRIMSTONE)) {
info.setReturnValue(POISON_COLOR);
info.cancel();
return;
if (Math.abs(pos.getX() - x) != 2 || Math.abs(pos.getZ() - z) != 2) {
if ((world.getBlockState(mut).isOf(EndBlocks.BRIMSTONE))) {
color = STREAM_COLOR;
scanDeep = false;
}
}
}
}
}
info.setReturnValue(color);
}
}

View file

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