本文整理汇总了Java中net.minecraft.world.World.loadItemData方法的典型用法代码示例。如果您正苦于以下问题:Java World.loadItemData方法的具体用法?Java World.loadItemData怎么用?Java World.loadItemData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.World
的用法示例。
在下文中一共展示了World.loadItemData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: func_143027_a
import net.minecraft.world.World; //导入方法依赖的package包/类
private void func_143027_a(World worldIn)
{
if (this.structureData == null)
{
this.structureData = (MapGenStructureData)worldIn.loadItemData(MapGenStructureData.class, this.getStructureName());
if (this.structureData == null)
{
this.structureData = new MapGenStructureData(this.getStructureName());
worldIn.setItemData(this.getStructureName(), this.structureData);
}
else
{
NBTTagCompound nbttagcompound = this.structureData.getTagCompound();
for (String s : nbttagcompound.getKeySet())
{
NBTBase nbtbase = nbttagcompound.getTag(s);
if (nbtbase.getId() == 10)
{
NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbtbase;
if (nbttagcompound1.hasKey("ChunkX") && nbttagcompound1.hasKey("ChunkZ"))
{
int i = nbttagcompound1.getInteger("ChunkX");
int j = nbttagcompound1.getInteger("ChunkZ");
StructureStart structurestart = MapGenStructureIO.getStructureStart(nbttagcompound1, worldIn);
if (structurestart != null)
{
this.structureMap.put(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(i, j)), structurestart);
}
}
}
}
}
}
}
示例2: initializeStructureData
import net.minecraft.world.World; //导入方法依赖的package包/类
protected void initializeStructureData(World worldIn)
{
if (this.structureData == null)
{
this.structureData = (MapGenStructureData)worldIn.loadItemData(MapGenStructureData.class, this.getStructureName());
if (this.structureData == null)
{
this.structureData = new MapGenStructureData(this.getStructureName());
worldIn.setItemData(this.getStructureName(), this.structureData);
}
else
{
NBTTagCompound nbttagcompound = this.structureData.getTagCompound();
for (String s : nbttagcompound.getKeySet())
{
NBTBase nbtbase = nbttagcompound.getTag(s);
if (nbtbase.getId() == 10)
{
NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbtbase;
if (nbttagcompound1.hasKey("ChunkX") && nbttagcompound1.hasKey("ChunkZ"))
{
int i = nbttagcompound1.getInteger("ChunkX");
int j = nbttagcompound1.getInteger("ChunkZ");
StructureStart structurestart = MapGenStructureIO.getStructureStart(nbttagcompound1, worldIn);
if (structurestart != null)
{
this.structureMap.put(ChunkPos.asLong(i, j), structurestart);
}
}
}
}
}
}
}
示例3: func_143027_a
import net.minecraft.world.World; //导入方法依赖的package包/类
private void func_143027_a(World worldIn)
{
if (this.structureData == null)
{
if (Reflector.ForgeWorld_getPerWorldStorage.exists())
{
MapStorage mapstorage = (MapStorage)Reflector.call(worldIn, Reflector.ForgeWorld_getPerWorldStorage, new Object[0]);
this.structureData = (MapGenStructureData)mapstorage.loadData(MapGenStructureData.class, this.getStructureName());
}
else
{
this.structureData = (MapGenStructureData)worldIn.loadItemData(MapGenStructureData.class, this.getStructureName());
}
if (this.structureData == null)
{
this.structureData = new MapGenStructureData(this.getStructureName());
if (Reflector.ForgeWorld_getPerWorldStorage.exists())
{
MapStorage mapstorage1 = (MapStorage)Reflector.call(worldIn, Reflector.ForgeWorld_getPerWorldStorage, new Object[0]);
mapstorage1.setData(this.getStructureName(), this.structureData);
}
else
{
worldIn.setItemData(this.getStructureName(), this.structureData);
}
}
else
{
NBTTagCompound nbttagcompound1 = this.structureData.getTagCompound();
for (String s : nbttagcompound1.getKeySet())
{
NBTBase nbtbase = nbttagcompound1.getTag(s);
if (nbtbase.getId() == 10)
{
NBTTagCompound nbttagcompound = (NBTTagCompound)nbtbase;
if (nbttagcompound.hasKey("ChunkX") && nbttagcompound.hasKey("ChunkZ"))
{
int i = nbttagcompound.getInteger("ChunkX");
int j = nbttagcompound.getInteger("ChunkZ");
StructureStart structurestart = MapGenStructureIO.getStructureStart(nbttagcompound, worldIn);
if (structurestart != null)
{
this.structureMap.put(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(i, j)), structurestart);
this.structureLongMap.add(ChunkCoordIntPair.chunkXZ2Int(i, j), structurestart);
}
}
}
}
}
}
}
示例4: loadMapData
import net.minecraft.world.World; //导入方法依赖的package包/类
@Nullable
public static MapData loadMapData(int mapId, World worldIn)
{
String s = "map_" + mapId;
return (MapData)worldIn.loadItemData(MapData.class, s);
}