public override void writeEntityToNBT(NBTTagCompound nbttagcompound) { nbttagcompound.setInteger("Type", minecartType); if (minecartType == 2) { nbttagcompound.setDouble("PushX", pushX); nbttagcompound.setDouble("PushZ", pushZ); nbttagcompound.setShort("Fuel", (short)fuel); } else if (minecartType == 1) { var nbttaglist = new NBTTagList(); for (int i = 0; i < cargoItems.Length; i++) { if (cargoItems[i] != null) { var nbttagcompound1 = new NBTTagCompound(); nbttagcompound1.setByte("Slot", (byte)i); cargoItems[i].writeToNBT(nbttagcompound1); nbttaglist.setTag(nbttagcompound1); } } nbttagcompound.setTag("Items", nbttaglist); } }
public override void writeEntityToNBT(NBTTagCompound nbttagcompound) { nbttagcompound.setInteger("Type", minecartType); if (minecartType == 2) { nbttagcompound.setDouble("PushX", pushX); nbttagcompound.setDouble("PushZ", pushZ); nbttagcompound.setShort("Fuel", (short) fuel); } else if (minecartType == 1) { var nbttaglist = new NBTTagList(); for (int i = 0; i < cargoItems.Length; i++) { if (cargoItems[i] != null) { var nbttagcompound1 = new NBTTagCompound(); nbttagcompound1.setByte("Slot", (byte) i); cargoItems[i].writeToNBT(nbttagcompound1); nbttaglist.setTag(nbttagcompound1); } } nbttagcompound.setTag("Items", nbttaglist); } }