Java 类net.minecraft.world.chunk.Chunk.EnumCreateEntityType 实例源码

项目:OpenBlocks    文件:TankRenderUtils.java   
public static TileEntity getTileEntitySafe(World world, BlockPos pos) {
    if (world.isBlockLoaded(pos)) {
        Chunk chunk = world.getChunkFromBlockCoords(pos);
        return chunk.getTileEntity(pos, EnumCreateEntityType.CHECK);
    }

    return null;
}
项目:OpenBlocks    文件:TileEntityTank.java   
protected TileEntityTank getNeighourTank(BlockPos pos) {
    if (!world.isBlockLoaded(pos)) return null;

    Chunk chunk = world.getChunkFromBlockCoords(pos);
    TileEntity te = chunk.getTileEntity(pos, EnumCreateEntityType.CHECK);
    return (te instanceof TileEntityTank)? (TileEntityTank)te : null;
}
项目:EnderIO    文件:BlockStateWrapperBase.java   
@Override
public @Nullable TileEntity getTileEntity() {
  if (world instanceof ChunkCache) {
    return ((ChunkCache) world).getTileEntity(pos, EnumCreateEntityType.CHECK);
  }
  return world.getTileEntity(pos);
}