Amber slimes

This commit is contained in:
paulevsGitch 2021-01-13 04:09:55 +03:00
parent 878f4bbe63
commit 179d2a0035
6 changed files with 43 additions and 7 deletions

View file

@ -82,6 +82,9 @@ public class EntityEndSlime extends SlimeEntity {
else if (biome == EndBiomes.MEGALAKE || biome == EndBiomes.MEGALAKE_GROVE) {
this.setLake(true);
}
else if (biome == EndBiomes.AMBER_LAND) {
this.setAmber(true);
}
this.calculateDimensions();
return data;
}
@ -179,6 +182,14 @@ public class EntityEndSlime extends SlimeEntity {
return this.dataTracker.get(VARIANT) == 2;
}
protected void setAmber(boolean mossy) {
this.dataTracker.set(VARIANT, (byte) 3);
}
public boolean isAmber() {
return this.dataTracker.get(VARIANT) == 3;
}
public static boolean canSpawn(EntityType<EntityEndSlime> type, ServerWorldAccess world, SpawnReason spawnReason, BlockPos pos, Random random) {
return isPermanentBiome(world, pos) || (notManyEntities(world, pos, 32, 3) && isWaterNear(world, pos, 32, 8));
}