fix chunkregion entity spawn crash

This commit is contained in:
dfsek
2022-06-07 13:56:02 -07:00
parent 9a640de8d3
commit 372931a9c5

View File

@@ -81,10 +81,8 @@ public abstract class ChunkRegionMixin {
this.config = ((ServerWorld) world).getPack();
}
@SuppressWarnings("deprecation")
public Entity terraWorld$spawnEntity(Vector3 location, EntityType entityType) {
net.minecraft.entity.Entity entity = ((net.minecraft.entity.EntityType<?>) entityType).create(
((ChunkRegion) (Object) this).toServerWorld());
net.minecraft.entity.Entity entity = ((net.minecraft.entity.EntityType<?>) entityType).create(null);
entity.setPos(location.getX(), location.getY(), location.getZ());
((ChunkRegion) (Object) this).spawnEntity(entity);
return (Entity) entity;