Water color

This commit is contained in:
paulevsGitch 2020-12-02 04:31:32 +03:00
parent 10fae49f6a
commit 539da4bac1
10 changed files with 56 additions and 13 deletions

View file

@ -0,0 +1,43 @@
package ru.betterend.mixin.client;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
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.world.BlockRenderView;
import ru.betterend.registry.EndBlocks;
import ru.betterend.util.MHelper;
@Mixin(BiomeColors.class)
public class BiomeColorsMixin {
private static final int POISON_COLOR = MHelper.color(92, 160, 78);
@Inject(method = "getWaterColor", at = @At("HEAD"), 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;
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++) {
mut.setZ(z);
if (world.getBlockState(mut).isOf(EndBlocks.BRIMSTONE)) {
info.setReturnValue(POISON_COLOR);
info.cancel();
return;
}
}
}
}
}
}

View file

@ -166,6 +166,10 @@ public class BiomeDefinition {
return this; return this;
} }
public BiomeDefinition setWaterAndFogColor(int r, int g, int b) {
return setWaterColor(r, g, b).setWaterFogColor(r, g, b);
}
public BiomeDefinition setFoliageColor(int r, int g, int b) { public BiomeDefinition setFoliageColor(int r, int g, int b) {
this.foliageColor = getColor(r, g, b); this.foliageColor = getColor(r, g, b);
return this; return this;

View file

@ -12,8 +12,7 @@ public class BiomeDustWastelands extends EndBiome {
.setFogColor(226, 239, 168) .setFogColor(226, 239, 168)
.setFogDensity(2) .setFogDensity(2)
.setCaves(false) .setCaves(false)
.setWaterColor(192, 180, 131) .setWaterAndFogColor(192, 180, 131)
.setWaterFogColor(192, 180, 131)
.setSurface(EndBlocks.ENDSTONE_DUST) .setSurface(EndBlocks.ENDSTONE_DUST)
.setParticles(ParticleTypes.WHITE_ASH, 0.01F) .setParticles(ParticleTypes.WHITE_ASH, 0.01F)
.setLoop(EndSounds.AMBIENT_DUST_WASTELANDS) .setLoop(EndSounds.AMBIENT_DUST_WASTELANDS)

View file

@ -15,8 +15,7 @@ public class BiomeFoggyMushroomland extends EndBiome {
.setPlantsColor(73, 210, 209) .setPlantsColor(73, 210, 209)
.setFogColor(41, 122, 173) .setFogColor(41, 122, 173)
.setFogDensity(3) .setFogDensity(3)
.setWaterColor(119, 227, 250) .setWaterAndFogColor(119, 227, 250)
.setWaterFogColor(119, 227, 250)
.setSurface(EndBlocks.END_MOSS, EndBlocks.END_MYCELIUM) .setSurface(EndBlocks.END_MOSS, EndBlocks.END_MYCELIUM)
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F) .setParticles(EndParticles.GLOWING_SPHERE, 0.001F)
.setLoop(EndSounds.AMBIENT_FOGGY_MUSHROOMLAND) .setLoop(EndSounds.AMBIENT_FOGGY_MUSHROOMLAND)

View file

@ -12,8 +12,7 @@ public class BiomeMegalake extends EndBiome {
super(new BiomeDefinition("megalake") super(new BiomeDefinition("megalake")
.setPlantsColor(73, 210, 209) .setPlantsColor(73, 210, 209)
.setFogColor(178, 209, 248) .setFogColor(178, 209, 248)
.setWaterColor(96, 163, 255) .setWaterAndFogColor(96, 163, 255)
.setWaterFogColor(96, 163, 255)
.setFogDensity(1.75F) .setFogDensity(1.75F)
.setMusic(EndSounds.MUSIC_MEGALAKE) .setMusic(EndSounds.MUSIC_MEGALAKE)
.setLoop(EndSounds.AMBIENT_MEGALAKE) .setLoop(EndSounds.AMBIENT_MEGALAKE)

View file

@ -13,8 +13,7 @@ public class BiomeMegalakeGrove extends EndBiome {
super(new BiomeDefinition("megalake_grove") super(new BiomeDefinition("megalake_grove")
.setPlantsColor(73, 210, 209) .setPlantsColor(73, 210, 209)
.setFogColor(178, 209, 248) .setFogColor(178, 209, 248)
.setWaterColor(96, 163, 255) .setWaterAndFogColor(96, 163, 255)
.setWaterFogColor(96, 163, 255)
.setFogDensity(2.0F) .setFogDensity(2.0F)
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F) .setParticles(EndParticles.GLOWING_SPHERE, 0.001F)
.setMusic(EndSounds.MUSIC_MEGALAKE) .setMusic(EndSounds.MUSIC_MEGALAKE)

View file

@ -12,8 +12,7 @@ public class BiomePaintedMountains extends EndBiome {
.setFogColor(226, 239, 168) .setFogColor(226, 239, 168)
.setFogDensity(2) .setFogDensity(2)
.setCaves(false) .setCaves(false)
.setWaterColor(192, 180, 131) .setWaterAndFogColor(192, 180, 131)
.setWaterFogColor(192, 180, 131)
.setMusic(EndSounds.MUSIC_DUST_WASTELANDS) .setMusic(EndSounds.MUSIC_DUST_WASTELANDS)
.setLoop(EndSounds.AMBIENT_DUST_WASTELANDS) .setLoop(EndSounds.AMBIENT_DUST_WASTELANDS)
.setSurface(EndBlocks.ENDSTONE_DUST) .setSurface(EndBlocks.ENDSTONE_DUST)

View file

@ -14,8 +14,7 @@ public class BiomeShadowForest extends EndBiome {
.setFogColor(0, 0, 0) .setFogColor(0, 0, 0)
.setFogDensity(2.5F) .setFogDensity(2.5F)
.setPlantsColor(45, 45, 45) .setPlantsColor(45, 45, 45)
.setWaterColor(42, 45, 80) .setWaterAndFogColor(42, 45, 80)
.setWaterFogColor(42, 45, 80)
.setSurface(EndBlocks.SHADOW_GRASS) .setSurface(EndBlocks.SHADOW_GRASS)
.setParticles(ParticleTypes.MYCELIUM, 0.01F) .setParticles(ParticleTypes.MYCELIUM, 0.01F)
.setLoop(EndSounds.AMBIENT_CHORUS_FOREST) .setLoop(EndSounds.AMBIENT_CHORUS_FOREST)

View file

@ -9,6 +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)
.setFogColor(207, 194, 62) .setFogColor(207, 194, 62)
.setFogDensity(1.5F) .setFogDensity(1.5F)
.setCaves(false) .setCaves(false)

View file

@ -15,7 +15,8 @@
"MinecraftClientMixin", "MinecraftClientMixin",
"WorldRendererMixin", "WorldRendererMixin",
"MusicTrackerMixin", "MusicTrackerMixin",
"ModelLoaderMixin" "ModelLoaderMixin",
"BiomeColorsMixin"
], ],
"injectors": { "injectors": {
"defaultRequire": 1 "defaultRequire": 1