[Fixes] Disabling end entities result in crashes (by Necrontyrr)
Merge pull request #112 from Necrontyrr/disable-spawn
This commit is contained in:
commit
d15d2e86ae
7 changed files with 27 additions and 27 deletions
|
@ -82,13 +82,13 @@ public class SilkMothHiveBlock extends BaseBlock {
|
|||
if (!world.getBlockState(spawn).isAir()) {
|
||||
return;
|
||||
}
|
||||
int count = world.getEntities(EndEntities.SILK_MOTH, new AABB(pos).inflate(16), (entity) -> {
|
||||
int count = world.getEntities(EndEntities.SILK_MOTH.type(), new AABB(pos).inflate(16), (entity) -> {
|
||||
return true;
|
||||
}).size();
|
||||
if (count > 6) {
|
||||
return;
|
||||
}
|
||||
SilkMothEntity moth = new SilkMothEntity(EndEntities.SILK_MOTH, world);
|
||||
SilkMothEntity moth = new SilkMothEntity(EndEntities.SILK_MOTH.type(), world);
|
||||
moth.moveTo(spawn.getX() + 0.5, spawn.getY() + 0.5, spawn.getZ() + 0.5, dir.toYRot(), 0);
|
||||
moth.setDeltaMovement(new Vec3(dir.getStepX() * 0.4, 0, dir.getStepZ() * 0.4));
|
||||
moth.setHive(world, pos);
|
||||
|
|
|
@ -149,13 +149,13 @@ public class SilkMothNestBlock extends BaseBlock implements RenderLayerProvider
|
|||
if (!world.getBlockState(spawn).isAir()) {
|
||||
return;
|
||||
}
|
||||
int count = world.getEntities(EndEntities.SILK_MOTH, new AABB(pos).inflate(16), (entity) -> {
|
||||
int count = world.getEntities(EndEntities.SILK_MOTH.type(), new AABB(pos).inflate(16), (entity) -> {
|
||||
return true;
|
||||
}).size();
|
||||
if (count > 6) {
|
||||
return;
|
||||
}
|
||||
SilkMothEntity moth = new SilkMothEntity(EndEntities.SILK_MOTH, world);
|
||||
SilkMothEntity moth = new SilkMothEntity(EndEntities.SILK_MOTH.type(), world);
|
||||
moth.moveTo(spawn.getX() + 0.5, spawn.getY() + 0.5, spawn.getZ() + 0.5, dir.toYRot(), 0);
|
||||
moth.setDeltaMovement(new Vec3(dir.getStepX() * 0.4, 0, dir.getStepZ() * 0.4));
|
||||
moth.setHive(world, pos);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue