本文整理汇总了Java中net.minecraft.world.chunk.storage.AnvilChunkLoader.readWorldEntity方法的典型用法代码示例。如果您正苦于以下问题:Java AnvilChunkLoader.readWorldEntity方法的具体用法?Java AnvilChunkLoader.readWorldEntity怎么用?Java AnvilChunkLoader.readWorldEntity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.chunk.storage.AnvilChunkLoader
的用法示例。
在下文中一共展示了AnvilChunkLoader.readWorldEntity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCachedEntity
import net.minecraft.world.chunk.storage.AnvilChunkLoader; //导入方法依赖的package包/类
public Entity getCachedEntity()
{
if (this.cachedEntity == null)
{
this.cachedEntity = AnvilChunkLoader.readWorldEntity(this.randomEntity.getNbt(), this.getSpawnerWorld(), false);
if (this.randomEntity.getNbt().getSize() == 1 && this.randomEntity.getNbt().hasKey("id", 8) && this.cachedEntity instanceof EntityLiving)
{
((EntityLiving)this.cachedEntity).onInitialSpawn(this.getSpawnerWorld().getDifficultyForLocation(new BlockPos(this.cachedEntity)), (IEntityLivingData)null);
}
}
return this.cachedEntity;
}
示例2: getCachedEntity
import net.minecraft.world.chunk.storage.AnvilChunkLoader; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public Entity getCachedEntity()
{
if (this.cachedEntity == null)
{
this.cachedEntity = AnvilChunkLoader.readWorldEntity(this.randomEntity.getNbt(), this.getSpawnerWorld(), false);
if (this.randomEntity.getNbt().getSize() == 1 && this.randomEntity.getNbt().hasKey("id", 8) && this.cachedEntity instanceof EntityLiving)
{
((EntityLiving)this.cachedEntity).onInitialSpawn(this.getSpawnerWorld().getDifficultyForLocation(new BlockPos(this.cachedEntity)), (IEntityLivingData)null);
}
}
return this.cachedEntity;
}