本文整理匯總了Java中cpw.mods.fml.common.registry.GameData.writeItemData方法的典型用法代碼示例。如果您正苦於以下問題:Java GameData.writeItemData方法的具體用法?Java GameData.writeItemData怎麽用?Java GameData.writeItemData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cpw.mods.fml.common.registry.GameData
的用法示例。
在下文中一共展示了GameData.writeItemData方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getDataForWriting
import cpw.mods.fml.common.registry.GameData; //導入方法依賴的package包/類
@Override
public NBTTagCompound getDataForWriting(SaveHandler handler, WorldInfo info)
{
NBTTagCompound fmlData = new NBTTagCompound();
NBTTagList list = new NBTTagList();
for (ModContainer mc : Loader.instance().getActiveModList())
{
NBTTagCompound mod = new NBTTagCompound();
mod.func_74778_a("ModId", mc.getModId());
mod.func_74778_a("ModVersion", mc.getVersion());
list.func_74742_a(mod);
}
fmlData.func_74782_a("ModList", list);
NBTTagList itemList = new NBTTagList();
GameData.writeItemData(itemList);
fmlData.func_74782_a("ModItemData", itemList);
return fmlData;
}
示例2: getDataForWriting
import cpw.mods.fml.common.registry.GameData; //導入方法依賴的package包/類
@Override
public NBTTagCompound getDataForWriting(SaveHandler handler, WorldInfo info)
{
NBTTagCompound fmlData = new NBTTagCompound();
NBTTagList list = new NBTTagList();
for (ModContainer mc : Loader.instance().getActiveModList())
{
NBTTagCompound mod = new NBTTagCompound();
mod.setString("ModId", mc.getModId());
mod.setString("ModVersion", mc.getVersion());
list.appendTag(mod);
}
fmlData.setTag("ModList", list);
NBTTagList itemList = new NBTTagList();
GameData.writeItemData(itemList);
fmlData.setTag("ModItemData", itemList);
return fmlData;
}
示例3: buildmodIdItemIdHashMap
import cpw.mods.fml.common.registry.GameData; //導入方法依賴的package包/類
public static void buildmodIdItemIdHashMap()
{
NBTTagList itemDataList = new NBTTagList();
GameData.writeItemData(itemDataList);
for (int i = 0; i < itemDataList.tagCount(); i++)
{
ItemData data = new ItemData((NBTTagCompound) itemDataList.tagAt(i));
modIdItemIdMapping.put(data.getItemId(), data.getModId());
}
}