2012-12-17 21:21:53 +01:00
|
|
|
package com.pahimar.ee3.network.packet;
|
2012-09-21 22:13:21 +02:00
|
|
|
|
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
|
import java.io.DataInputStream;
|
|
|
|
import java.io.DataOutputStream;
|
|
|
|
import java.io.IOException;
|
2012-12-13 16:01:41 +01:00
|
|
|
|
2012-12-19 19:09:56 +01:00
|
|
|
import net.minecraft.network.INetworkManager;
|
|
|
|
|
2012-12-17 21:21:53 +01:00
|
|
|
import com.pahimar.ee3.network.PacketTypeHandler;
|
|
|
|
|
2012-09-21 22:13:21 +02:00
|
|
|
import cpw.mods.fml.common.network.Player;
|
|
|
|
|
2012-10-27 23:41:02 +02:00
|
|
|
/**
|
|
|
|
* PacketEE
|
|
|
|
*
|
|
|
|
* General packet for EE3 related packets
|
|
|
|
*
|
|
|
|
* @author pahimar
|
|
|
|
* @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html)
|
|
|
|
*
|
|
|
|
*/
|
2012-09-21 22:13:21 +02:00
|
|
|
public class PacketEE {
|
2012-12-19 19:09:56 +01:00
|
|
|
|
|
|
|
public PacketTypeHandler packetType;
|
|
|
|
public boolean isChunkDataPacket;
|
|
|
|
|
|
|
|
public PacketEE(PacketTypeHandler packetType, boolean isChunkDataPacket) {
|
|
|
|
|
|
|
|
this.packetType = packetType;
|
|
|
|
this.isChunkDataPacket = isChunkDataPacket;
|
|
|
|
}
|
|
|
|
|
|
|
|
public byte[] populate() {
|
|
|
|
|
|
|
|
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
|
|
|
DataOutputStream dos = new DataOutputStream(bos);
|
|
|
|
|
|
|
|
try {
|
|
|
|
dos.writeByte(packetType.ordinal());
|
|
|
|
this.writeData(dos);
|
|
|
|
}
|
|
|
|
catch (IOException e) {
|
|
|
|
e.printStackTrace(System.err);
|
|
|
|
}
|
|
|
|
|
|
|
|
return bos.toByteArray();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void readPopulate(DataInputStream data) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
this.readData(data);
|
|
|
|
}
|
|
|
|
catch (IOException e) {
|
|
|
|
e.printStackTrace(System.err);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void readData(DataInputStream data) throws IOException {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void writeData(DataOutputStream dos) throws IOException {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void execute(INetworkManager network, Player player) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setKey(int key) {
|
|
|
|
|
|
|
|
}
|
2012-09-21 22:13:21 +02:00
|
|
|
}
|