// Path: scripting/network/ScriptPacketHandler.java
// public abstract class ScriptPacketHandler {
// 
// 	public abstract void handleSelection(SelectionPacket pkt, EntityPlayer player);
// 	public abstract void handleHasScripts(HasScriptsPacket pkt, EntityPlayer player);
// 	public abstract void handleState(StatePacket pkt, EntityPlayer player);
// 
// 	public abstract void handleSettings(SettingsPacket pkt, EntityPlayer player);
// 
// 	public abstract void handleEntityNBT(EntityNBTPacket pkt, EntityPlayer player);
// 	public abstract void handleTileNBT(TileNBTPacket pkt, EntityPlayer player);
// 
// 	public abstract void handleCloseGUI(CloseGUIPacket pkt, EntityPlayer player);
// 	public abstract void handleRequest(PacketType type, String info, EntityPlayer player);
// 
// 	protected abstract boolean hasPermission(EntityPlayer player);
// 
// 	public final void handlePacket(ScriptPacket packet, EntityPlayer player) {
// 		if (hasPermission(player))
// 			packet.execute(this, player);
// 	}
// }


import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufInputStream;
import io.netty.buffer.ByteBufOutputStream;
import io.netty.channel.ChannelHandlerContext;
import java.io.IOException;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import scripting.network.ScriptPacketHandler;
package scripting.packet;




public class TileNBTPacket extends ScriptPacket {

	public int x, y, z;
	public NBTTagCompound tag;

	@Override
	public ScriptPacket readData(Object... data) {
		x = (Integer) data[0];
		y = (Integer) data[1];
		x = (Integer) data[2];
		tag = (NBTTagCompound) data[3];
		return this;
	}
	
	@Override
	public void encodeInto(ChannelHandlerContext ctx, ByteBuf to) throws IOException { 
		ByteBufOutputStream bos = new ByteBufOutputStream(to);
		bos.writeInt(x);
		bos.writeInt(y);
		bos.writeInt(z);
		writeNBT(tag, bos);
	}

	@Override
	public void decodeFrom(ChannelHandlerContext ctx, ByteBuf from) throws IOException { 
		ByteBufInputStream bis = new ByteBufInputStream(from);
		x = bis.readInt();
		y = bis.readInt();
		z = bis.readInt();
		tag = readNBT(bis);
	}

	@Override
// Path: scripting/network/ScriptPacketHandler.java
// public abstract class ScriptPacketHandler {
// 
// 	public abstract void handleSelection(SelectionPacket pkt, EntityPlayer player);
// 	public abstract void handleHasScripts(HasScriptsPacket pkt, EntityPlayer player);
// 	public abstract void handleState(StatePacket pkt, EntityPlayer player);
// 
// 	public abstract void handleSettings(SettingsPacket pkt, EntityPlayer player);
// 
// 	public abstract void handleEntityNBT(EntityNBTPacket pkt, EntityPlayer player);
// 	public abstract void handleTileNBT(TileNBTPacket pkt, EntityPlayer player);
// 
// 	public abstract void handleCloseGUI(CloseGUIPacket pkt, EntityPlayer player);
// 	public abstract void handleRequest(PacketType type, String info, EntityPlayer player);
// 
// 	protected abstract boolean hasPermission(EntityPlayer player);
// 
// 	public final void handlePacket(ScriptPacket packet, EntityPlayer player) {
// 		if (hasPermission(player))
// 			packet.execute(this, player);
// 	}
// }


// Path: scripting/packet/TileNBTPacket.java
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufInputStream;
import io.netty.buffer.ByteBufOutputStream;
import io.netty.channel.ChannelHandlerContext;
import java.io.IOException;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import scripting.network.ScriptPacketHandler;

package scripting.packet;




public class TileNBTPacket extends ScriptPacket {

	public int x, y, z;
	public NBTTagCompound tag;

	@Override
	public ScriptPacket readData(Object... data) {
		x = (Integer) data[0];
		y = (Integer) data[1];
		x = (Integer) data[2];
		tag = (NBTTagCompound) data[3];
		return this;
	}
	
	@Override
	public void encodeInto(ChannelHandlerContext ctx, ByteBuf to) throws IOException { 
		ByteBufOutputStream bos = new ByteBufOutputStream(to);
		bos.writeInt(x);
		bos.writeInt(y);
		bos.writeInt(z);
		writeNBT(tag, bos);
	}

	@Override
	public void decodeFrom(ChannelHandlerContext ctx, ByteBuf from) throws IOException { 
		ByteBufInputStream bis = new ByteBufInputStream(from);
		x = bis.readInt();
		y = bis.readInt();
		z = bis.readInt();
		tag = readNBT(bis);
	}

	@Override
	public void execute(ScriptPacketHandler handler, EntityPlayer player) {