Added basic aesu controls, just need to finish the gui :)
This commit is contained in:
parent
92b95b9ff0
commit
9b1093c22c
5 changed files with 154 additions and 0 deletions
41
src/main/java/techreborn/packets/PacketAesu.java
Normal file
41
src/main/java/techreborn/packets/PacketAesu.java
Normal file
|
@ -0,0 +1,41 @@
|
|||
package techreborn.packets;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import techreborn.tiles.TileAesu;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class PacketAesu extends SimplePacket {
|
||||
|
||||
|
||||
public PacketAesu() {
|
||||
}
|
||||
|
||||
int buttonID;
|
||||
|
||||
TileAesu aesu;
|
||||
|
||||
public PacketAesu(int buttonID, TileAesu aesu) {
|
||||
this.aesu = aesu;
|
||||
this.buttonID = buttonID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeData(ByteBuf out) throws IOException {
|
||||
SimplePacket.writeTileEntity(aesu, out);
|
||||
out.writeInt(buttonID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readData(ByteBuf in) throws IOException {
|
||||
this.aesu = (TileAesu) SimplePacket.readTileEntity(in);
|
||||
buttonID = in.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
if(!aesu.getWorldObj().isRemote){
|
||||
aesu.handleGuiInputFromClient(buttonID);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -21,6 +21,7 @@ public class PacketHandler extends
|
|||
private static EnumMap<Side, FMLEmbeddedChannel> channels;
|
||||
|
||||
public PacketHandler() {
|
||||
addDiscriminator(0, PacketAesu.class);
|
||||
}
|
||||
|
||||
public static EnumMap<Side, FMLEmbeddedChannel> getChannels()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue