Java 类net.minecraft.util.datafix.IDataWalker 实例源码
项目:Backmemed
文件:Entity.java
public static void func_190533_a(DataFixer p_190533_0_)
{
p_190533_0_.registerWalker(FixTypes.ENTITY, new IDataWalker()
{
public NBTTagCompound process(IDataFixer fixer, NBTTagCompound compound, int versionIn)
{
if (compound.hasKey("Passengers", 9))
{
NBTTagList nbttaglist = compound.getTagList("Passengers", 10);
for (int i = 0; i < nbttaglist.tagCount(); ++i)
{
nbttaglist.set(i, fixer.process(FixTypes.ENTITY, nbttaglist.getCompoundTagAt(i), versionIn));
}
}
return compound;
}
});
}
项目:Backmemed
文件:EntityPlayerMP.java
public static void func_191522_a(DataFixer p_191522_0_)
{
p_191522_0_.registerWalker(FixTypes.PLAYER, new IDataWalker()
{
public NBTTagCompound process(IDataFixer fixer, NBTTagCompound compound, int versionIn)
{
if (compound.hasKey("RootVehicle", 10))
{
NBTTagCompound nbttagcompound = compound.getCompoundTag("RootVehicle");
if (nbttagcompound.hasKey("Entity", 10))
{
nbttagcompound.setTag("Entity", fixer.process(FixTypes.ENTITY, nbttagcompound.getCompoundTag("Entity"), versionIn));
}
}
return compound;
}
});
}
项目:ExpandedRailsMod
文件:EntityMinecartCommandBlock.java
public static void func_189670_a(DataFixer p_189670_0_)
{
EntityMinecart.func_189669_a(p_189670_0_, "MinecartCommandBlock");
p_189670_0_.registerWalker(FixTypes.ENTITY, new IDataWalker()
{
public NBTTagCompound process(IDataFixer fixer, NBTTagCompound compound, int versionIn)
{
if ("MinecartCommandBlock".equals(compound.getString("id")))
{
compound.setString("id", "Control");
fixer.process(FixTypes.BLOCK_ENTITY, compound, versionIn);
compound.setString("id", "MinecartCommandBlock");
}
return compound;
}
});
}
项目:ExpandedRailsMod
文件:EntityMinecartMobSpawner.java
public static void func_189672_a(DataFixer p_189672_0_)
{
func_189669_a(p_189672_0_, "MinecartSpawner");
p_189672_0_.registerWalker(FixTypes.ENTITY, new IDataWalker()
{
public NBTTagCompound process(IDataFixer fixer, NBTTagCompound compound, int versionIn)
{
if ("MinecartSpawner".equals(compound.getString("id")))
{
compound.setString("id", "MobSpawner");
fixer.process(FixTypes.BLOCK_ENTITY, compound, versionIn);
compound.setString("id", "MinecartSpawner");
}
return compound;
}
});
}
项目:Backmemed
文件:Template.java
public static void func_191158_a(DataFixer p_191158_0_)
{
p_191158_0_.registerWalker(FixTypes.STRUCTURE, new IDataWalker()
{
public NBTTagCompound process(IDataFixer fixer, NBTTagCompound compound, int versionIn)
{
if (compound.hasKey("entities", 9))
{
NBTTagList nbttaglist = compound.getTagList("entities", 10);
for (int i = 0; i < nbttaglist.tagCount(); ++i)
{
NBTTagCompound nbttagcompound = (NBTTagCompound)nbttaglist.get(i);
if (nbttagcompound.hasKey("nbt", 10))
{
nbttagcompound.setTag("nbt", fixer.process(FixTypes.ENTITY, nbttagcompound.getCompoundTag("nbt"), versionIn));
}
}
}
if (compound.hasKey("blocks", 9))
{
NBTTagList nbttaglist1 = compound.getTagList("blocks", 10);
for (int j = 0; j < nbttaglist1.tagCount(); ++j)
{
NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttaglist1.get(j);
if (nbttagcompound1.hasKey("nbt", 10))
{
nbttagcompound1.setTag("nbt", fixer.process(FixTypes.BLOCK_ENTITY, nbttagcompound1.getCompoundTag("nbt"), versionIn));
}
}
}
return compound;
}
});
}
项目:ExpandedRailsMod
文件:EntityPlayer.java
public static void func_189806_a(DataFixer p_189806_0_)
{
p_189806_0_.registerWalker(FixTypes.PLAYER, new IDataWalker()
{
public NBTTagCompound process(IDataFixer fixer, NBTTagCompound compound, int versionIn)
{
DataFixesManager.processInventory(fixer, compound, versionIn, "Inventory");
DataFixesManager.processInventory(fixer, compound, versionIn, "EnderItems");
return compound;
}
});
}
项目:ExpandedRailsMod
文件:EntityVillager.java
public static void func_189785_b(DataFixer p_189785_0_)
{
EntityLiving.func_189752_a(p_189785_0_, "Villager");
p_189785_0_.registerWalker(FixTypes.ENTITY, new ItemStackDataLists("Villager", new String[] {"Inventory"}));
p_189785_0_.registerWalker(FixTypes.ENTITY, new IDataWalker()
{
public NBTTagCompound process(IDataFixer fixer, NBTTagCompound compound, int versionIn)
{
if ("Villager".equals(compound.getString("id")) && compound.hasKey("Offers", 10))
{
NBTTagCompound nbttagcompound = compound.getCompoundTag("Offers");
if (nbttagcompound.hasKey("Recipes", 9))
{
NBTTagList nbttaglist = nbttagcompound.getTagList("Recipes", 10);
for (int i = 0; i < nbttaglist.tagCount(); ++i)
{
NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
DataFixesManager.processItemStack(fixer, nbttagcompound1, versionIn, "buy");
DataFixesManager.processItemStack(fixer, nbttagcompound1, versionIn, "buyB");
DataFixesManager.processItemStack(fixer, nbttagcompound1, versionIn, "sell");
nbttaglist.set(i, nbttagcompound1);
}
}
}
return compound;
}
});
}