mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 00:37:52 +00:00
Use the liquid name in liquid stack persistence. Closes #429
This commit is contained in:
1 parent
e5315714a9
commit
91cecec28a
1 file changed
+13
-2
@@ -41,14 +41,25 @@ public class LiquidStack
|
||||
nbt.setShort("Id", (short)itemID);
|
||||
nbt.setInteger("Amount", amount);
|
||||
nbt.setShort("Meta", (short)itemMeta);
|
||||
nbt.setString("LiquidName", LiquidDictionary.findLiquidName(this));
|
||||
return nbt;
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound nbt)
|
||||
{
|
||||
itemID = nbt.getShort("Id");
|
||||
String liquidName = nbt.getString("LiquidName");
|
||||
if (liquidName != null)
|
||||
{
|
||||
LiquidStack liquid = LiquidDictionary.getCanonicalLiquid(liquidName);
|
||||
itemID = liquid.itemID;
|
||||
itemMeta = liquid.itemMeta;
|
||||
}
|
||||
else
|
||||
{
|
||||
itemID = nbt.getShort("Id");
|
||||
itemMeta = nbt.getShort("Meta");
|
||||
}
|
||||
amount = nbt.getInteger("Amount");
|
||||
itemMeta = nbt.getShort("Meta");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user