package common.packet;

import java.io.IOException;

import common.network.IClientPlayer;
import common.network.Packet;
import common.network.PacketBuffer;

public class SPacketServerTick implements Packet<IClientPlayer> {
	private int time;

	public SPacketServerTick() {
	}

	public SPacketServerTick(int time) {
		this.time = time;
	}

	public void readPacketData(PacketBuffer buf) throws IOException {
		this.time = buf.readInt();
	}

	public void writePacketData(PacketBuffer buf) throws IOException {
		buf.writeInt(this.time);
	}

	public void processPacket(IClientPlayer handler) {
		handler.handleServerTick(this);
	}

    public int getTime() {
        return this.time;
    }
}
