当前位置: 首页>>代码示例>>Java>>正文


Java World.loadItemData方法代码示例

本文整理汇总了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);
                        }
                    }
                }
            }
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:40,代码来源:MapGenStructure.java

示例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);
                        }
                    }
                }
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:40,代码来源:MapGenStructure.java

示例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);
                        }
                    }
                }
            }
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:58,代码来源:MapGenStructure.java

示例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);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:7,代码来源:ItemMap.java


注:本文中的net.minecraft.world.World.loadItemData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。