add server

This commit is contained in:
Sen 2025-05-01 15:13:38 +02:00
parent d5269922b9
commit 76ecfb39ab
25 changed files with 603 additions and 520 deletions

View file

@ -0,0 +1,34 @@
package game.packet;
import java.io.IOException;
import game.network.ClientPlayer;
import game.network.Packet;
import game.network.PacketBuffer;
public class SPacketServerTick implements Packet<ClientPlayer> {
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(ClientPlayer handler) {
handler.handleServerTick(this);
}
public int getTime() {
return this.time;
}
}