Skip to content

Commit

Permalink
0.4.1 Fixed some bug
Browse files Browse the repository at this point in the history
  • Loading branch information
TWME-TW committed Mar 28, 2024
1 parent 43d9fd8 commit 1f7497f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ public static boolean canChange(UUID playerUUID, Block block) {
Player player = Bukkit.getPlayer(playerUUID);
World world = block.getWorld();

if (player.hasPermission("debugstickpro.bypassregion")) {
return true;
}

boolean canChange = true;

if (ConfigFile.WhitelistWorlds.Enabled) {
Expand All @@ -39,9 +43,6 @@ public static boolean canChange(UUID playerUUID, Block block) {
}
}
}
if (player.hasPermission("debugstickpro.bypassregion")) {
canChange = true;
}

return canChange;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,23 @@ public static boolean check(Player player, boolean checkItem) {
return false;
}
if (!player.isOnline()) {
return returnFalse(player);
removePlayerFromDisplayList(player);
return false;
}
if (!player.hasPermission("debugstickpro.use")) {
return returnFalse(player);
removePlayerFromDisplayList(player);
return false;
}
if (checkItem) {
if (!DebugStickItem.checkPlayer(player)) {
return returnFalse(player);
removePlayerFromDisplayList(player);
return false;
}
}
return true;
}

private static boolean returnFalse(Player player) {
private static void removePlayerFromDisplayList(Player player) {
PlayerDataManager.removePlayerFromDisplayList(player.getUniqueId());
return false;
}
}
11 changes: 5 additions & 6 deletions src/main/resources/lang/en_US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ LangFileVersion: 3
CommandsMessages:
Help:
HelpMessage:
- "<b><gold>Debug Stick</gold></b> - <gray>Plugin to modify block data."
- "<gray>Commands:</gray>"
- "<gray> /dsp reload - <gold>Reloads the plugin."
- "<gray> /dsp give <player> - <gold>Gives Debug Stick to the player."
- "<gray> /dsp mode <classic|copy|freeze> - <gold>Changes the mode of the Debug Stick."
- "<gray> /dsp - <gold>Shows the help message."
- "<b>Debug Stick <red>Pro</red></b>"
- "<gray> /dsp <aqua>reload</aqua> - <white>Reloads the plugin.</white>"
- "<gray> /dsp <aqua>give</aqua> <light_purple>[player]</light_purple> - <white>Gives Debug Stick to the player.</white>"
- "<gray> /dsp <aqua>mode</aqua> <white><<gold>classic</gold>|<red>copy</red>|<blue>freeze</blue>></white> - <white>Changes the mode of the Debug Stick.</white>"
- "<gray> /dsp <light_purple>[help]</light_purple> - <white>Shows the help message.</white>"
Reload:
Success: "Reloaded successfully."
Give:
Expand Down

0 comments on commit 1f7497f

Please sign in to comment.