package ch.spacebase.mc.protocol.packet.ingame.server.entity;

import java.io.IOException;

import ch.spacebase.mc.protocol.data.game.values.MagicValues;
import ch.spacebase.mc.protocol.data.game.values.entity.EntityStatus;
import ch.spacebase.packetlib.io.NetInput;
import ch.spacebase.packetlib.io.NetOutput;
import ch.spacebase.packetlib.packet.Packet;

public class ServerEntityStatusPacket implements Packet {
	
	protected int entityId;
	protected EntityStatus status;
	
	@SuppressWarnings("unused")
	private ServerEntityStatusPacket() {
	}
	
	public ServerEntityStatusPacket(int entityId, EntityStatus status) {
		this.entityId = entityId;
		this.status = status;
	}
	
	public EntityStatus getStatus() {
		return this.status;
	}

	@Override
	public void read(NetInput in) throws IOException {
		this.entityId = in.readInt();
		this.status = MagicValues.key(EntityStatus.class, in.readByte());
	}

	@Override
	public void write(NetOutput out) throws IOException {
		out.writeInt(this.entityId);
		out.writeByte(MagicValues.value(Integer.class, this.status));
	}
	
	@Override
	public boolean isPriority() {
		return false;
	}

}

@@ -664,24 +664,81 @@
 tatus;%0A%09%7D%0A%09%0A
+%09public int getEntityId() %7B%0A%09%09return this.entityId;%0A%09%7D%0A%09%0A
 %09public Enti

Add getEntityId() to ServerEntityStatusPacket