equivalent-exchange-3/ee3_common/com/pahimar/ee3/network/packet/PacketTileUpdate.java
2013-03-06 21:46:19 -05:00

60 lines
1.4 KiB
Java

package com.pahimar.ee3.network.packet;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import net.minecraft.network.INetworkManager;
import com.pahimar.ee3.network.PacketTypeHandler;
import cpw.mods.fml.common.network.Player;
/**
* PacketTileUpdate
*
* Packet specifically for updating/synching tile entities between client and
* server
*
* @author pahimar
* @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html)
*
*/
public class PacketTileUpdate extends PacketEE {
public int x, y, z;
public short state;
public String player;
public String customName;
public PacketTileUpdate() {
super(PacketTypeHandler.TILE, true);
}
public void writeData(DataOutputStream data) throws IOException {
data.writeInt(x);
data.writeInt(y);
data.writeInt(z);
data.writeShort(state);
data.writeUTF(player);
data.writeUTF(customName);
}
public void readData(DataInputStream data) throws IOException {
this.x = data.readInt();
this.y = data.readInt();
this.z = data.readInt();
this.state = data.readShort();
this.player = data.readUTF();
this.customName = data.readUTF();
}
public void execute(INetworkManager manager, Player player) {
// TODO: Stuff here
}
}