1
0
Fork 0

fix unneccesary debug classes

This commit is contained in:
Sen 2025-05-31 18:56:55 +02:00
parent 5534531416
commit 493230c4a6
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
7 changed files with 30 additions and 389 deletions

View file

@ -54,6 +54,7 @@ import client.gui.element.Area;
import client.gui.ingame.GuiGameOver;
import client.network.ClientLoginHandler;
import client.network.ClientPlayer;
import client.network.DummyConnection;
import client.renderer.BlockRenderer;
import client.renderer.Drawing;
import client.renderer.EntityRenderer;
@ -106,9 +107,11 @@ import common.block.Block;
import common.collect.Lists;
import common.collect.Maps;
import common.color.TextColor;
import common.dimension.Space;
import common.entity.Entity;
import common.entity.animal.EntityHorse;
import common.entity.npc.Energy;
import common.entity.npc.EntityCpu;
import common.entity.npc.EntityNPC;
import common.entity.npc.PlayerCharacter;
import common.entity.types.EntityLiving;
@ -297,7 +300,7 @@ public class Client implements IThreadListener {
public boolean jump;
public boolean sneak;
public boolean debugCamEnable;
public boolean noResolve;
public boolean debugWorld;
public boolean zooming;
public boolean sprint;
public boolean renderOutlines;
@ -577,11 +580,29 @@ public class Client implements IThreadListener {
}, "Server connector").start();
}
public void joinDebugWorld() {
ClientPlayer player = new ClientPlayer(this, new DummyConnection());
this.debugWorld = true;
this.charEditor = false;
this.controller = new PlayerController(this, player);
WorldClient world = new WorldClient(this, Space.INSTANCE);
this.loadWorld(world, EntityRegistry.getEntityID(EntityCpu.class));
this.player.setId(0);
this.displayGuiScreen(null);
this.player.flying = true;
this.player.noclip = true;
this.player.addEffect(new PotionEffect(Potion.FLYING, Integer.MAX_VALUE, 1));
this.player.setHeight(2.0f);
world.setGravity(this.gravity = 1.0f);
world.setTimeFactor(this.timeFactor = 1);
this.dayCycle = true;
}
public void unloadWorld() {
ClientPlayer netHandler = this.getNetHandler();
if(netHandler != null)
netHandler.cleanup();
this.noResolve = false;
this.debugWorld = false;
this.charEditor = false;
this.viewEntity = null;
this.connection = null;
@ -1891,7 +1912,7 @@ public class Client implements IThreadListener {
BlockPos pos = this.pointed.block;
State block = this.world.getState(pos);
if(!this.noResolve) {
if(!this.debugWorld) {
block = block.getBlock().getActualState(block, this.world, pos);
}