1
0
Fork 0

remove server side debug

This commit is contained in:
Sen 2025-05-31 16:46:48 +02:00
parent f4c024cde7
commit 374e0c4617
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
22 changed files with 1084 additions and 801 deletions

View file

@ -22,7 +22,6 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Queue;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executors;
@ -111,6 +110,7 @@ import common.entity.Entity;
import common.entity.animal.EntityHorse;
import common.entity.npc.Energy;
import common.entity.npc.EntityNPC;
import common.entity.npc.PlayerCharacter;
import common.entity.types.EntityLiving;
import common.future.Futures;
import common.future.ListenableFuture;
@ -286,7 +286,9 @@ public class Client implements IThreadListener {
private final List<Message> feed = Lists.newArrayList();
private final List<Message> hotbar = Lists.newArrayList();
private final File config = new File(System.getProperty("config.file", "client.cfg"));
public final Map<String, Integer> playerList = Maps.<String, Integer>newTreeMap();
public final List<PlayerCharacter> characterList = Lists.<PlayerCharacter>newArrayList();
private boolean primary;
private boolean secondary;
private boolean tertiary;
@ -295,7 +297,7 @@ public class Client implements IThreadListener {
public boolean jump;
public boolean sneak;
public boolean debugCamEnable;
public boolean debugWorld;
public boolean noResolve;
public boolean zooming;
public boolean sprint;
public boolean renderOutlines;
@ -316,6 +318,7 @@ public class Client implements IThreadListener {
public int thirdPersonView;
public int timeFactor = 1;
public int chunksUpdated;
public int selectedCharacter = -1;
private long lastTicked = 0L;
private long debugUpdateTime = System.currentTimeMillis();
@ -578,7 +581,7 @@ public class Client implements IThreadListener {
ClientPlayer netHandler = this.getNetHandler();
if(netHandler != null)
netHandler.cleanup();
this.debugWorld = false;
this.noResolve = false;
this.charEditor = false;
this.viewEntity = null;
this.connection = null;
@ -586,6 +589,9 @@ public class Client implements IThreadListener {
this.player = null;
this.serverInfo = null;
this.lastTickTime = -1;
this.selectedCharacter = -1;
this.playerList.clear();
this.characterList.clear();
this.soundManager.stopSounds();
}
@ -1885,7 +1891,7 @@ public class Client implements IThreadListener {
BlockPos pos = this.pointed.block;
State block = this.world.getState(pos);
if(!this.debugWorld) {
if(!this.noResolve) {
block = block.getBlock().getActualState(block, this.world, pos);
}
@ -2472,7 +2478,7 @@ public class Client implements IThreadListener {
public void unload(boolean loading) {
if(this.world != null && this.getNetHandler() != null)
this.getNetHandler().getNetworkManager().closeChannel("Quitting");
this.getNetHandler().getConnection().closeChannel("Quitting");
this.unloadWorld();
this.displayGuiScreen(GuiMenu.INSTANCE);
}
@ -2701,7 +2707,7 @@ public class Client implements IThreadListener {
this.registerDebug(Keysym.AE, "Programm sofort beenden und server beenden", new DebugRunner() {
public void execute(Keysym key) {
if(Client.this.getNetHandler() != null) {
Client.this.getNetHandler().getNetworkManager().sendPacket(new CPacketMessage(CPacketMessage.Type.COMMAND, "shutdown"), new GenericFutureListener<Future<? super Void>>() {
Client.this.getNetHandler().getConnection().sendPacket(new CPacketMessage(CPacketMessage.Type.COMMAND, "shutdown"), new GenericFutureListener<Future<? super Void>>() {
public void operationComplete(Future<? super Void> u) throws Exception {
try {
Thread.sleep(1000L);
@ -3192,13 +3198,12 @@ public class Client implements IThreadListener {
public void drawInfo() {
ClientPlayer netHandler = this.getNetHandler();
if(netHandler != null) {
Set<Entry<String, Integer>> list = netHandler.getPlayerList();
int size = list.size();
int size = this.playerList.size();
int w = size > 80 ? 4 : (size > 40 ? 3 : (size > 10 ? 2 : 1));
w = Math.min(w, Math.max(1, this.fb_x / 300));
int bx = 0;
int by = 0;
for(Entry<String, Integer> elem : list) {
for(Entry<String, Integer> elem : this.playerList.entrySet()) {
int x = this.fb_x / 2 - (w * 300) / 2 + bx * 300;
int y = 10 + by * Font.YGLYPH;
Drawing.drawGradient(x, y, 300, Font.YGLYPH, 0x7f404040, 0x7f000000);