Skip to content

Commit

Permalink
debug setting to disable enforcing spawn seq
Browse files Browse the repository at this point in the history
  • Loading branch information
rfresh2 committed Nov 23, 2024
1 parent ffaa41a commit a268d14
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/main/java/com/zenith/command/impl/DebugCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public CommandUsage commandUsage() {
"teleportResync on/off",
"ncpStrictInventory on/off",
"debugLogs on/off",
"chunkCacheFullbright on/off"
"chunkCacheFullbright on/off",
"enforceSpawnSeq on/off"
)
);
}
Expand Down Expand Up @@ -173,6 +174,12 @@ public LiteralArgumentBuilder<CommandContext> register() {
c.getSource().getEmbed()
.title("Chunk Cache Fullbright " + toggleStrCaps(CONFIG.debug.server.cache.fullbrightChunkSkylight));
return OK;
})))
.then(literal("enforceSpawnSeq").then(argument("toggle", toggle()).executes(c -> {
CONFIG.debug.enforcePlayerSpawnSequence = getToggle(c, "toggle");
c.getSource().getEmbed()
.title("Enforce Spawn Seq " + toggleStrCaps(CONFIG.debug.enforcePlayerSpawnSequence));
return OK;
})));
}

Expand All @@ -189,6 +196,7 @@ public void postPopulate(final Embed builder) {
.addField("NCP Strict Inventory", toggleStr(CONFIG.debug.ncpStrictInventory), false)
.addField("Debug Logs", toggleStr(CONFIG.debug.debugLogs), false)
.addField("Chunk Cache Fullbright", toggleStr(CONFIG.debug.server.cache.fullbrightChunkSkylight), false)
.addField("Enforce Spawn Seq", toggleStr(CONFIG.debug.enforcePlayerSpawnSequence), false)
.primaryColor();
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/zenith/network/server/ServerSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public class ServerSession extends TcpServerSession {
protected boolean isConfigured = false;
// player has accepted the spawn teleport and position packets
// if false, we cancel any outbound teleport and position packets
protected boolean spawned = false;
protected boolean spawned = !CONFIG.debug.enforcePlayerSpawnSequence;
// player has accepted the spawn teleport and we are awaiting the position packet
protected boolean spawning = false;
// default spawn teleport id
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/zenith/util/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ public static final class Debug {
public boolean resyncTeleports = true;
public boolean ncpStrictInventory = false;
public boolean debugLogs = false;
public boolean enforcePlayerSpawnSequence = true;

public static final class PacketLog {
public boolean enabled = false;
Expand Down

0 comments on commit a268d14

Please sign in to comment.