TechReborn/src/main/java/techreborn/packets/PacketAesu.java

41 lines
801 B
Java
Raw Normal View History

package techreborn.packets;
2016-10-08 21:46:16 +02:00
import io.netty.buffer.ByteBuf;
2016-03-25 10:47:34 +01:00
import reborncore.common.packets.SimplePacket;
import techreborn.tiles.TileAesu;
2016-10-08 21:46:16 +02:00
import java.io.IOException;
public class PacketAesu extends SimplePacket {
2016-03-25 10:47:34 +01:00
int buttonID;
TileAesu aesu;
2016-10-08 21:46:16 +02:00
public PacketAesu() {
2016-03-25 10:47:34 +01:00
}
2016-10-08 21:46:16 +02:00
public PacketAesu(int buttonID, TileAesu aesu) {
2016-03-25 10:47:34 +01:00
this.aesu = aesu;
this.buttonID = buttonID;
}
@Override
2016-10-08 21:46:16 +02:00
public void writeData(ByteBuf out) throws IOException {
2016-03-25 10:47:34 +01:00
SimplePacket.writeTileEntity(aesu, out);
out.writeInt(buttonID);
}
@Override
2016-10-08 21:46:16 +02:00
public void readData(ByteBuf in) throws IOException {
2016-03-25 10:47:34 +01:00
this.aesu = (TileAesu) SimplePacket.readTileEntity(in);
buttonID = in.readInt();
}
@Override
2016-10-08 21:46:16 +02:00
public void execute() {
if (!aesu.getWorld().isRemote) {
2016-03-25 10:47:34 +01:00
aesu.handleGuiInputFromClient(buttonID);
}
}
}