fix chunkregion entity spawn crash

This commit is contained in:
dfsek
2022-06-07 13:56:02 -07:00
parent 9a640de8d3
commit 372931a9c5
@@ -81,10 +81,8 @@ public abstract class ChunkRegionMixin {
this.config = ((ServerWorld) world).getPack(); this.config = ((ServerWorld) world).getPack();
} }
@SuppressWarnings("deprecation")
public Entity terraWorld$spawnEntity(Vector3 location, EntityType entityType) { public Entity terraWorld$spawnEntity(Vector3 location, EntityType entityType) {
net.minecraft.entity.Entity entity = ((net.minecraft.entity.EntityType<?>) entityType).create( net.minecraft.entity.Entity entity = ((net.minecraft.entity.EntityType<?>) entityType).create(null);
((ChunkRegion) (Object) this).toServerWorld());
entity.setPos(location.getX(), location.getY(), location.getZ()); entity.setPos(location.getX(), location.getY(), location.getZ());
((ChunkRegion) (Object) this).spawnEntity(entity); ((ChunkRegion) (Object) this).spawnEntity(entity);
return (Entity) entity; return (Entity) entity;