Skip to content

Commit

Permalink
[ci skip] Fix chunkstats command typo
Browse files Browse the repository at this point in the history
  • Loading branch information
HaHaWTH committed Dec 12, 2024
1 parent 8fb1211 commit 037c6be
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,15 @@ public boolean execute(CommandSender sender, String commandLabel, String[] args)

sender.sendMessage("Chunks Time:");
for (ChunkTime chunkTime : chunkList) {
if (chunkTime.chunk == null) continue;
int chunkX = chunkTime.chunk.x;
int chunkZ = chunkTime.chunk.z;
int posX = chunkX << 4;
int posZ = chunkZ << 4;
int time = (int) (chunkTime.time / 1000 / 1000);
int avg = totalTick > 0 ? time / totalTick : 0;

TextComponent component = new TextComponent(String.format("[%s: %d,%d at chunk %d,%d] has running time: %d ms (Arg %d ms/tick)", chunkTime.chunk.world.getWorld().getName(), posX, posZ, chunkX, chunkZ, time, avg));
TextComponent component = new TextComponent(String.format("[%s: %d,%d at chunk %d,%d] has running time: %d ms (Avg %d ms/tick)", chunkTime.chunk.world.getWorld().getName(), posX, posZ, chunkX, chunkZ, time, avg));
component.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, String.format("/minecraft:tp %d 128 %d", posX, posZ)));
component.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent[]{new TextComponent(String.format("Execute command: /minecraft:tp %d 128 %d", posX, posZ))}));
sender.spigot().sendMessage(component);
Expand Down

0 comments on commit 037c6be

Please sign in to comment.