Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package lavaInfusionTileEntity;
- import lavaInfusionMain.Base;
- import lavaInfusionPackets.MagmaChargePacket;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.tileentity.TileEntity;
- public class TileEntityMagmaFoundation extends TileEntity
- {
- private int chargeCount = 0; //Number of charges held
- public int getChargeCount()
- {
- return chargeCount;
- }
- @Override
- public void readFromNBT(NBTTagCompound nbt)
- {
- super.readFromNBT(nbt);
- this.chargeCount = nbt.getInteger("chargeCount");
- Base.network.sendToServer(new MagmaChargePacket(chargeCount));
- }
- @Override
- public void writeToNBT(NBTTagCompound nbt)
- {
- super.writeToNBT(nbt);
- nbt.setInteger("chargeCount", chargeCount);
- }
- //Non Forge Related Methods Below
- public void setChargeCount(int that)
- {
- this.chargeCount = that;
- }
- public void addCharges(int amt)
- {
- this.chargeCount += amt;
- }
- public void useCharges(int amt)
- {
- this.chargeCount -= amt;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment