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.gui.ingame.GuiGameOver;
import client.network.ClientLoginHandler; import client.network.ClientLoginHandler;
import client.network.ClientPlayer; import client.network.ClientPlayer;
import client.network.DummyConnection;
import client.renderer.BlockRenderer; import client.renderer.BlockRenderer;
import client.renderer.Drawing; import client.renderer.Drawing;
import client.renderer.EntityRenderer; import client.renderer.EntityRenderer;
@ -106,9 +107,11 @@ import common.block.Block;
import common.collect.Lists; import common.collect.Lists;
import common.collect.Maps; import common.collect.Maps;
import common.color.TextColor; import common.color.TextColor;
import common.dimension.Space;
import common.entity.Entity; import common.entity.Entity;
import common.entity.animal.EntityHorse; import common.entity.animal.EntityHorse;
import common.entity.npc.Energy; import common.entity.npc.Energy;
import common.entity.npc.EntityCpu;
import common.entity.npc.EntityNPC; import common.entity.npc.EntityNPC;
import common.entity.npc.PlayerCharacter; import common.entity.npc.PlayerCharacter;
import common.entity.types.EntityLiving; import common.entity.types.EntityLiving;
@ -297,7 +300,7 @@ public class Client implements IThreadListener {
public boolean jump; public boolean jump;
public boolean sneak; public boolean sneak;
public boolean debugCamEnable; public boolean debugCamEnable;
public boolean noResolve; public boolean debugWorld;
public boolean zooming; public boolean zooming;
public boolean sprint; public boolean sprint;
public boolean renderOutlines; public boolean renderOutlines;
@ -577,11 +580,29 @@ public class Client implements IThreadListener {
}, "Server connector").start(); }, "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() { public void unloadWorld() {
ClientPlayer netHandler = this.getNetHandler(); ClientPlayer netHandler = this.getNetHandler();
if(netHandler != null) if(netHandler != null)
netHandler.cleanup(); netHandler.cleanup();
this.noResolve = false; this.debugWorld = false;
this.charEditor = false; this.charEditor = false;
this.viewEntity = null; this.viewEntity = null;
this.connection = null; this.connection = null;
@ -1891,7 +1912,7 @@ public class Client implements IThreadListener {
BlockPos pos = this.pointed.block; BlockPos pos = this.pointed.block;
State block = this.world.getState(pos); State block = this.world.getState(pos);
if(!this.noResolve) { if(!this.debugWorld) {
block = block.getBlock().getActualState(block, this.world, pos); block = block.getBlock().getActualState(block, this.world, pos);
} }

View file

@ -9,7 +9,6 @@ import client.gui.element.Label;
import client.gui.element.NavButton; import client.gui.element.NavButton;
import client.gui.element.PressType; import client.gui.element.PressType;
import client.gui.options.GuiOptions; import client.gui.options.GuiOptions;
import client.network.DummyPlayer;
import client.renderer.Drawing; import client.renderer.Drawing;
import client.window.Keysym; import client.window.Keysym;
import common.color.TextColor; import common.color.TextColor;
@ -55,7 +54,7 @@ public class GuiMenu extends Gui {
this.add(new ActButton(0, -28, 400, 24, new ButtonCallback() { this.add(new ActButton(0, -28, 400, 24, new ButtonCallback() {
public void use(ActButton elem, PressType action) { public void use(ActButton elem, PressType action) {
if(action == PressType.SECONDARY) { if(action == PressType.SECONDARY) {
new DummyPlayer(GuiMenu.this.gm).join(); GuiMenu.this.gm.joinDebugWorld();
return; return;
} }
if(GuiMenu.this.hacked == 9) { if(GuiMenu.this.hacked == 9) {

View file

@ -225,7 +225,7 @@ public class ClientPlayer implements IClientPlayer
NetHandler.checkThread(packetIn, this, this.gm); NetHandler.checkThread(packetIn, this, this.gm);
this.gm.charEditor = packetIn.isInEditor(); this.gm.charEditor = packetIn.isInEditor();
this.gm.controller = new PlayerController(this.gm, this); this.gm.controller = new PlayerController(this.gm, this);
this.world = new WorldClient(this.gm, false, packetIn.getDimension()); this.world = new WorldClient(this.gm, packetIn.getDimension());
// this.gameController.gameSettings.difficulty = packetIn.getDifficulty(); // this.gameController.gameSettings.difficulty = packetIn.getDifficulty();
this.gm.loadWorld(this.world, packetIn.getEntityType()); this.gm.loadWorld(this.world, packetIn.getEntityType());
// this.gameController.thePlayer.dimension = this.clientWorldController.dimension.getDimensionId(); // this.gameController.thePlayer.dimension = this.clientWorldController.dimension.getDimensionId();
@ -1078,7 +1078,7 @@ public class ClientPlayer implements IClientPlayer
// this.travelSound = "portal.travel"; // this.travelSound = "portal.travel";
// } // }
// Scoreboard scoreboard = this.clientWorldController.getScoreboard(); // Scoreboard scoreboard = this.clientWorldController.getScoreboard();
this.world = new WorldClient(this.gm, false, dim); this.world = new WorldClient(this.gm, dim);
// this.clientWorldController.setWorldScoreboard(scoreboard); // this.clientWorldController.setWorldScoreboard(scoreboard);
this.gm.loadWorld(this.world, packetIn.getEntityType()); this.gm.loadWorld(this.world, packetIn.getEntityType());
// this.gameController.thePlayer.dimension = dim.getDimensionId(); // this.gameController.thePlayer.dimension = dim.getDimensionId();

View file

@ -1,302 +0,0 @@
package client.network;
import client.Client;
import client.util.DummyController;
import client.world.WorldClient;
import common.dimension.Space;
import common.entity.Entity;
import common.entity.npc.EntityCpu;
import common.init.EntityRegistry;
import common.model.ParticleType;
import common.network.Packet;
import common.packet.SPacketEntity;
import common.packet.SPacketEntityTeleport;
import common.packet.SPacketEntityHeadLook;
import common.packet.SPacketEntityStatus;
import common.packet.SPacketEntityAttach;
import common.packet.SPacketEntityMetadata;
import common.packet.SPacketEntityEffect;
import common.packet.SPacketRemoveEntityEffect;
import common.packet.SPacketEntityProperties;
import common.packet.SPacketExplosion;
import common.packet.SPacketEffect;
import common.packet.SPacketSoundEffect;
import common.packet.SPacketParticles;
import common.packet.SPacketChangeGameState;
import common.packet.SPacketSpawnGlobalEntity;
import common.packet.SPacketOpenWindow;
import common.packet.SPacketCloseWindow;
import common.packet.SPacketSetSlot;
import common.packet.SPacketWindowItems;
import common.packet.SPacketWindowProperty;
import common.packet.SPacketConfirmTransaction;
import common.packet.SPacketUpdateSign;
import common.packet.SPacketUpdateTileEntity;
import common.packet.SPacketSignEditorOpen;
import common.packet.SPacketPlayerListItem;
import common.packet.SPacketPlayerAbilities;
import common.packet.SPacketTabComplete;
import common.packet.SPacketUpdateEntityTags;
import common.packet.SPacketAnimation;
import common.packet.SPacketBiome;
import common.packet.SPacketBlockAction;
import common.packet.SPacketBlockBreakAnim;
import common.packet.SPacketBlockChange;
import common.packet.SPacketCamera;
import common.packet.SPacketCharacterList;
import common.packet.SPacketChunkData;
import common.packet.SPacketCollectItem;
import common.packet.SPacketDestroyEntities;
import common.packet.SPacketDimensionName;
import common.packet.SPacketDisconnect;
import common.packet.SPacketDisplayForm;
import common.packet.SPacketEntityEquipment;
import common.packet.SPacketEntityVelocity;
import common.packet.SPacketHeldItemChange;
import common.packet.SPacketJoinGame;
import common.packet.SPacketKeepAlive;
import common.packet.SPacketLoading;
import common.packet.SPacketMapChunkBulk;
import common.packet.SPacketMessage;
import common.packet.SPacketMultiBlockChange;
import common.packet.SPacketPlayerPosLook;
import common.packet.SPacketRespawn;
import common.packet.SPacketServerTick;
import common.packet.SPacketSetExperience;
import common.packet.SPacketSkin;
import common.packet.SPacketSpawnMob;
import common.packet.SPacketSpawnObject;
import common.packet.SPacketSpawnPlayer;
import common.packet.SPacketTimeUpdate;
import common.packet.SPacketTrades;
import common.packet.SPacketUpdateHealth;
import common.packet.SPacketWorld;
import common.potion.Potion;
import common.potion.PotionEffect;
import common.sound.Sound;
public class DummyPlayer extends ClientPlayer {
public DummyPlayer(Client gm) {
super(gm, new DummyConnection());
}
public void join() {
this.gm.noResolve = true;
this.gm.charEditor = false;
this.gm.controller = new DummyController(this);
WorldClient world = new WorldClient(this.gm, true, Space.INSTANCE);
this.gm.loadWorld(world, EntityRegistry.getEntityID(EntityCpu.class));
this.gm.player.setId(0);
this.gm.displayGuiScreen(null);
this.gm.player.flying = true;
this.gm.player.noclip = true;
this.gm.player.addEffect(new PotionEffect(Potion.FLYING, Integer.MAX_VALUE, 1));
this.gm.player.setHeight(2.0f);
world.setGravity(this.gm.gravity = 1.0f);
world.setTimeFactor(this.gm.timeFactor = 1);
this.gm.dayCycle = true;
}
public void cleanup() {
}
public void playSound(Sound sound) {
}
public void emitParticleAtEntity(Entity entityIn, ParticleType particleTypes) {
}
public void onDisconnect(String reason) {
}
public void addToSendQueue(Packet packet) {
}
public void handleJoinGame(SPacketJoinGame packetIn) {
}
public void handleSpawnObject(SPacketSpawnObject packetIn) {
}
public void handleSpawnGlobalEntity(SPacketSpawnGlobalEntity packetIn) {
}
public void handleEntityVelocity(SPacketEntityVelocity packetIn) {
}
public void handleEntityMetadata(SPacketEntityMetadata packetIn) {
}
public void handleSpawnPlayer(SPacketSpawnPlayer packetIn) {
}
public void handleEntityTeleport(SPacketEntityTeleport packetIn) {
}
public void handleHeldItemChange(SPacketHeldItemChange packetIn) {
}
public void handleEntityMovement(SPacketEntity packetIn) {
}
public void handleEntityHeadLook(SPacketEntityHeadLook packetIn) {
}
public void handleDestroyEntities(SPacketDestroyEntities packetIn) {
}
public void handlePlayerPosLook(SPacketPlayerPosLook packetIn) {
}
public void handleMultiBlockChange(SPacketMultiBlockChange packetIn) {
}
public void handleChunkData(SPacketChunkData packetIn) {
}
public void handleBiomes(SPacketBiome packetIn) {
}
public void handleBlockChange(SPacketBlockChange packetIn) {
}
public void handleDisconnect(SPacketDisconnect packetIn) {
}
public void handleCollectItem(SPacketCollectItem packetIn) {
}
public void handleMessage(SPacketMessage packetIn) {
}
public void handleLoading(SPacketLoading packet) {
}
public void handleAnimation(SPacketAnimation packetIn) {
}
public void handleSpawnMob(SPacketSpawnMob packetIn) {
}
public void handleTimeUpdate(SPacketTimeUpdate packetIn) {
}
public void handleServerTick(SPacketServerTick packet) {
}
public void handleEntityAttach(SPacketEntityAttach packetIn) {
}
public void handleEntityStatus(SPacketEntityStatus packetIn) {
}
public void handleUpdateHealth(SPacketUpdateHealth packetIn) {
}
public void handleSetExperience(SPacketSetExperience packetIn) {
}
public void handleRespawn(SPacketRespawn packetIn) {
}
public void handleExplosion(SPacketExplosion packetIn) {
}
public void handleOpenWindow(SPacketOpenWindow packetIn) {
}
public void handleSetSlot(SPacketSetSlot packetIn) {
}
public void handleConfirmTransaction(SPacketConfirmTransaction packetIn) {
}
public void handleWindowItems(SPacketWindowItems packetIn) {
}
public void handleSignEditorOpen(SPacketSignEditorOpen packetIn) {
}
public void handleForm(SPacketDisplayForm packet) {
}
public void handleUpdateSign(SPacketUpdateSign packetIn) {
}
public void handleUpdateTileEntity(SPacketUpdateTileEntity packetIn) {
}
public void handleWindowProperty(SPacketWindowProperty packetIn) {
}
public void handleEntityEquipment(SPacketEntityEquipment packetIn) {
}
public void handleCloseWindow(SPacketCloseWindow packetIn) {
}
public void handleBlockAction(SPacketBlockAction packetIn) {
}
public void handleBlockBreakAnim(SPacketBlockBreakAnim packetIn) {
}
public void handleMapChunkBulk(SPacketMapChunkBulk packetIn) {
}
public void handleChangeGameState(SPacketChangeGameState packetIn) {
}
public void handleEffect(SPacketEffect packetIn) {
}
public void handleEntityEffect(SPacketEntityEffect packetIn) {
}
public void handleCamera(SPacketCamera packetIn) {
}
public void handleRemoveEntityEffect(SPacketRemoveEntityEffect packetIn) {
}
public void handlePlayerListItem(SPacketPlayerListItem packetIn) {
}
public void handleCharacterList(SPacketCharacterList packet) {
}
public void handleKeepAlive(SPacketKeepAlive packetIn) {
}
public void handlePlayerAbilities(SPacketPlayerAbilities packetIn) {
}
public void handleTabComplete(SPacketTabComplete packetIn) {
}
public void handleSoundEffect(SPacketSoundEffect packetIn) {
}
public void handleEntityTags(SPacketUpdateEntityTags packetIn) {
}
public void handleParticles(SPacketParticles packetIn) {
}
public void handleEntityProperties(SPacketEntityProperties packetIn) {
}
public void handleSkin(SPacketSkin packetIn) {
}
public void handleTrades(SPacketTrades packetIn) {
}
public void handleWorld(SPacketWorld packetIn) {
}
public void handleDimName(SPacketDimensionName packetIn) {
}
}

View file

@ -96,7 +96,7 @@ public class BlockRenderer
{ {
Block block = state.getBlock(); Block block = state.getBlock();
if (!this.gm.noResolve) if (!this.gm.debugWorld)
{ {
try try
{ {

View file

@ -1,77 +0,0 @@
package client.util;
import client.network.DummyPlayer;
import client.world.WorldClient;
import common.entity.Entity;
import common.entity.npc.EntityNPC;
import common.init.EntityRegistry;
import common.item.ItemStack;
import common.util.BlockPos;
import common.util.Facing;
import common.util.Vec3;
import common.world.World;
public class DummyController extends PlayerController {
private final DummyPlayer player;
public DummyController(DummyPlayer player) {
super(null, null);
this.player = player;
}
public boolean destroyBlock(BlockPos pos, Facing side) {
return false;
}
public boolean clickBlock(BlockPos pos, Facing face) {
return false;
}
public void resetProgress() {
}
public void resetInteraction() {
}
public boolean damageBlock(BlockPos pos, Facing face) {
return false;
}
public void update() {
}
public boolean clickRight(EntityNPC player, WorldClient world, ItemStack stack, BlockPos pos, Facing side, Vec3 hit) {
return false;
}
public boolean sendUseItem(EntityNPC player, World world, ItemStack stack) {
return false;
}
public EntityNPC createPlayerEntity(WorldClient world, int type) {
EntityNPC player = (EntityNPC)EntityRegistry.createEntityByID(type, world);
player.setClientPlayer(this.player);
return player;
}
public void attackEntity(EntityNPC player, Entity target) {
}
public boolean interact(EntityNPC player, Entity target) {
return false;
}
public ItemStack windowClick(int window, int slot, int button, int mode, EntityNPC player) {
return null;
}
public void sendEnchantPacket(int window, int button) {
}
public void stopUsing(EntityNPC player) {
}
public boolean isHittingBlock() {
return false;
}
}

View file

@ -54,11 +54,11 @@ public class WorldClient extends AWorldClient
protected int lastLightning; protected int lastLightning;
protected Vec3 lightColor = new Vec3(0xffffff); protected Vec3 lightColor = new Vec3(0xffffff);
public WorldClient(Client gm, boolean debug, Dimension dim) public WorldClient(Client gm, Dimension dim)
{ {
super(dim); super(dim);
this.gm = gm; this.gm = gm;
this.emptyChunk = new ChunkEmpty(this, debug); this.emptyChunk = new ChunkEmpty(this, this.gm.debugWorld);
this.calculateInitialSkylight(); this.calculateInitialSkylight();
this.calculateInitialWeather(); this.calculateInitialWeather();
this.setGravity(this.gm.gravity); this.setGravity(this.gm.gravity);