Use BCLBiome equals comparison instead of instance comparison. Fixes quiqueck/BetterEnd#88

This commit is contained in:
Necrontyr 2022-10-13 05:38:13 +02:00
parent 01a4bdbe8e
commit 54f1100e22
6 changed files with 16 additions and 16 deletions

View file

@ -51,7 +51,7 @@ public class CubozoaEntity extends AbstractSchoolingFish {
) {
SpawnGroupData data = super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityTag);
if (BiomeAPI.getBiome(world.getBiome(blockPosition())) == EndBiomes.SULPHUR_SPRINGS) {
if (BiomeAPI.getBiome(world.getBiome(blockPosition())).equals(EndBiomes.SULPHUR_SPRINGS)) {
this.entityData.set(VARIANT, (byte) 1);
}

View file

@ -59,7 +59,7 @@ public class EndFishEntity extends AbstractSchoolingFish {
) {
SpawnGroupData data = super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityTag);
if (BiomeAPI.getBiome(world.getBiome(blockPosition())) == EndBiomes.SULPHUR_SPRINGS) {
if (BiomeAPI.getBiome(world.getBiome(blockPosition())).equals(EndBiomes.SULPHUR_SPRINGS)) {
this.entityData.set(VARIANT, (byte) (random.nextInt(VARIANTS_SULPHUR) + VARIANTS_NORMAL));
}

View file

@ -90,12 +90,12 @@ public class EndSlimeEntity extends Slime {
) {
SpawnGroupData data = super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityTag);
BCLBiome biome = BiomeAPI.getBiome(world.getBiome(blockPosition()));
if (biome == EndBiomes.FOGGY_MUSHROOMLAND) {
if (biome.equals(EndBiomes.FOGGY_MUSHROOMLAND)) {
this.setMossy();
} else if (biome == EndBiomes.MEGALAKE || biome == EndBiomes.MEGALAKE_GROVE) {
} else if (biome.equals(EndBiomes.MEGALAKE) || biome.equals(EndBiomes.MEGALAKE_GROVE)) {
this.setLake();
} else if (biome == EndBiomes.AMBER_LAND) {
this.setAmber(true);
} else if (biome.equals(EndBiomes.AMBER_LAND)) {
this.setAmber();
}
this.refreshDimensions();
return data;
@ -205,7 +205,7 @@ public class EndSlimeEntity extends Slime {
return getSlimeType() == 2;
}
protected void setAmber(boolean mossy) {
protected void setAmber() {
this.entityData.set(VARIANT, (byte) 3);
}
@ -228,10 +228,10 @@ public class EndSlimeEntity extends Slime {
return false;
}
BCLBiome biome = BiomeAPI.getBiome(world.getBiome(pos));
if (biome == EndBiomes.CHORUS_FOREST || biome == EndBiomes.MEGALAKE) {
if (biome.equals(EndBiomes.CHORUS_FOREST) || biome.equals(EndBiomes.MEGALAKE)) {
return true;
}
if (biome == EndBiomes.MEGALAKE_GROVE && random.nextBoolean()) {
if (biome.equals(EndBiomes.MEGALAKE_GROVE) && random.nextBoolean()) {
return true;
}
return random.nextInt(4) == 0 && isWaterNear(world, pos);