9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-27 19:09:09 +00:00

Improve debug messages

This commit is contained in:
XiaoMoMi
2024-09-05 17:15:15 +08:00
parent 417f91472a
commit 442760922a
2 changed files with 59 additions and 10 deletions

View File

@@ -46,10 +46,12 @@ public class DebugDataCommand extends BukkitCommandFeature<CommandSender> {
.handler(context -> {
Player player = context.sender();
Location location;
Block block;
if (context.flags().hasFlag("this")) {
location = player.getLocation();
block = location.getBlock();
} else {
Block block = player.getTargetBlockExact(10);
block = player.getTargetBlockExact(10);
if (block == null) return;
location = block.getLocation();
}
@@ -57,12 +59,14 @@ public class DebugDataCommand extends BukkitCommandFeature<CommandSender> {
Optional<CustomCropsBlockState> state = world.getBlockState(Pos3.from(location));
if (state.isPresent()) {
BukkitCustomCropsPlugin.getInstance().getSenderFactory().wrap(player)
.sendMessage(AdventureHelper.miniMessage(state.get().toString()));
.sendMessage(AdventureHelper.miniMessage("<gold>" + state.get()));
} else {
BukkitCustomCropsPlugin.getInstance().getSenderFactory().wrap(player)
.sendMessage(AdventureHelper.miniMessage("Data not found"));
.sendMessage(AdventureHelper.miniMessage("<red>CustomCrops Data not found"));
}
});
BukkitCustomCropsPlugin.getInstance().getSenderFactory().wrap(player)
.sendMessage(AdventureHelper.miniMessage("<green>Vanilla crop data: " + block.getBlockData().getAsString()));
});
}