split server

This commit is contained in:
Sen 2025-05-03 18:01:17 +02:00
parent b0dc368ef7
commit 3ab017888b
25 changed files with 458 additions and 482 deletions

View file

@ -27,6 +27,7 @@ import game.entity.projectile.EntityProjectile;
import game.entity.types.EntityLiving;
import game.gui.Gui;
import game.gui.GuiConsole;
import game.gui.GuiLoading;
import game.gui.character.GuiChar;
import game.gui.character.GuiCharacters;
import game.gui.container.GuiMachine;
@ -89,12 +90,12 @@ import game.packet.SPacketEntityVelocity;
import game.packet.SPacketHeldItemChange;
import game.packet.SPacketJoinGame;
import game.packet.SPacketKeepAlive;
import game.packet.SPacketLoading;
import game.packet.SPacketMapChunkBulk;
import game.packet.SPacketMessage;
import game.packet.SPacketMultiBlockChange;
import game.packet.SPacketPlayerPosLook;
import game.packet.SPacketRespawn;
import game.packet.SPacketServerTick;
import game.packet.SPacketSetExperience;
import game.packet.SPacketSkin;
import game.packet.SPacketSpawnMob;
@ -795,6 +796,25 @@ public class ClientPlayer extends NetHandler
// }
}
public void handleLoading(SPacketLoading packet) {
NetHandler.checkThread(packet, this, this.gameController);
if(packet.getMessage() == null) {
if(packet.getTask() != null)
this.gameController.message = packet.getTask();
if(packet.getTotal() >= 0)
this.gameController.total = packet.getTotal();
if(packet.getProgress() >= -1)
this.gameController.progress = packet.getProgress();
}
else {
this.gameController.message = "";
this.gameController.total = 0;
this.gameController.progress = -1;
this.gameController.displayGuiScreen(GuiLoading.makeServerTask(packet.getMessage()));
}
}
// public void handleMessage(SPacketMessage packetIn)
// {
// NetHandler.checkThread(packetIn, this, this.gameController);
@ -1883,11 +1903,6 @@ public class ClientPlayer extends NetHandler
this.clientWorldController.dimension.setCustomName(packetIn.getCustomName());
}
public void handleServerTick(SPacketServerTick packet) {
NetHandler.checkThread(packet, this, this.gameController);
this.gameController.setLastTick(packet.getTime());
}
/**
* Returns this the NetworkManager instance registered with this NetworkHandlerPlayClient
*/