Fix entity spawning on paper

This commit is contained in:
ceze88 2024-01-11 15:55:54 +01:00
parent ab0490d31a
commit 59c2d186cd

View File

@ -196,7 +196,7 @@ public class EntityStackImpl implements EntityStack {
@Override @Override
public synchronized LivingEntity takeOneAndSpawnEntity(Location location) { public synchronized LivingEntity takeOneAndSpawnEntity(Location location) {
if (amount <= 0) return null; if (amount <= 0) return null;
LivingEntity entity = Objects.requireNonNull(location.getWorld()).spawn(location, hostEntity.getClass()); LivingEntity entity = (LivingEntity) Objects.requireNonNull(location.getWorld()).spawnEntity(location, hostEntity.getType());
if (Settings.NO_AI.getBoolean()) { if (Settings.NO_AI.getBoolean()) {
EntityUtils.setUnaware(entity); EntityUtils.setUnaware(entity);
} }