You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.5 KiB
Java

package net.brokenmoon.afloydwiremod.gui;
import net.brokenmoon.afloydwiremod.api.WireConnection;
import net.minecraft.src.NBTTagCompound;
public class WiringButton {
public int x;
public int y;
public String buttonString;
public int slot;
public float floatvalue;
public String stringvalue = "";
public WireConnection wire = new WireConnection();
public WiringButton(){
}
public WiringButton(int x, int y, String buttonString, int slot){
this.x = x;
this.y = y;
this.buttonString = buttonString;
this.slot = slot;
}
public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) {
nbttagcompound.setInteger("bx", this.x);
nbttagcompound.setInteger("by", this.y);
nbttagcompound.setString("bbuttonString", buttonString);
nbttagcompound.setInteger("bslot", slot);
nbttagcompound.setFloat("bfloatvalue", floatvalue);
nbttagcompound.setString("bstringvalue", stringvalue);
wire.writeToNBT(nbttagcompound);
return nbttagcompound;
}
public void readFromNBT(NBTTagCompound nbttagcompound) {
this.x = nbttagcompound.getInteger("bx");
this.y = nbttagcompound.getInteger("by");
this.buttonString = nbttagcompound.getString("bbuttonString");
this.slot = nbttagcompound.getInteger("bslot");
this.floatvalue = nbttagcompound.getFloat("bfloatvalue");
this.stringvalue = nbttagcompound.getString("bstringvalue");
wire.readFromNBT(nbttagcompound);
}
}