2024-01-21 22:16:26 +03:00
|
|
|
package noppes.npcs.client.gui.script;
|
|
|
|
|
|
|
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
|
|
|
|
import noppes.npcs.blocks.tiles.TileScripted;
|
|
|
|
|
import noppes.npcs.client.Client;
|
|
|
|
|
import noppes.npcs.constants.EnumPacketServer;
|
|
|
|
|
|
|
|
|
|
public class GuiScriptBlock extends GuiScriptInterface {
|
|
|
|
|
private TileScripted tileScripted;
|
|
|
|
|
|
|
|
|
|
public GuiScriptBlock(int x, int y, int z) {
|
|
|
|
|
hookList.add("init");
|
|
|
|
|
hookList.add("tick");
|
|
|
|
|
hookList.add("interact");
|
2024-01-21 22:39:22 +03:00
|
|
|
hookList.add("fallenUpon");
|
|
|
|
|
hookList.add("redstone");
|
|
|
|
|
hookList.add("broken");
|
|
|
|
|
hookList.add("exploded");
|
|
|
|
|
hookList.add("rainFilled");
|
|
|
|
|
hookList.add("neighborChanged");
|
|
|
|
|
hookList.add("clicked");
|
|
|
|
|
hookList.add("harvested");
|
|
|
|
|
hookList.add("collide");
|
|
|
|
|
hookList.add("timer");
|
2024-01-21 22:16:26 +03:00
|
|
|
|
|
|
|
|
this.handler = this.tileScripted = (TileScripted) player.worldObj.getTileEntity(x, y, z);
|
2024-01-21 22:48:48 +03:00
|
|
|
Client.sendData(EnumPacketServer.ScriptBlockDataGet, tileScripted.xCoord, tileScripted.yCoord, tileScripted.zCoord);
|
2024-01-21 22:16:26 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setGuiData(NBTTagCompound compound) {
|
|
|
|
|
this.tileScripted.setNBT(compound);
|
|
|
|
|
super.setGuiData(compound);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void save() {
|
|
|
|
|
super.save();
|
|
|
|
|
Client.sendData(EnumPacketServer.ScriptBlockDataSave, tileScripted.xCoord, tileScripted.yCoord, tileScripted.zCoord, this.tileScripted.getNBT(new NBTTagCompound()));
|
|
|
|
|
}
|
|
|
|
|
}
|