mirror of
https://github.com/Shiewk/SModeration.git
synced 2026-04-28 05:54:16 +02:00
Allow opening own ender chest
This commit is contained in:
@@ -28,16 +28,12 @@ public class EnderchestSeeCommand implements TabExecutor {
|
|||||||
if (sender instanceof HumanEntity human){
|
if (sender instanceof HumanEntity human){
|
||||||
final Player player = PlayerUtil.findOnlinePlayer(args[0]);
|
final Player player = PlayerUtil.findOnlinePlayer(args[0]);
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
if (human.getUniqueId().equals(player.getUniqueId())){
|
human.sendMessage(CHAT_PREFIX.append(
|
||||||
human.sendMessage(Component.text("You can't open your own ender chest.").color(FAIL_COLOR));
|
Component.text("Opening ender chest of ").color(PRIMARY_COLOR)
|
||||||
} else {
|
.append(Component.text(player.getName()).color(SECONDARY_COLOR))
|
||||||
human.sendMessage(CHAT_PREFIX.append(
|
.append(Component.text("."))
|
||||||
Component.text("Opening ender chest of ").color(PRIMARY_COLOR)
|
));
|
||||||
.append(Component.text(player.getName()).color(SECONDARY_COLOR))
|
human.openInventory(player.getEnderChest());
|
||||||
.append(Component.text("."))
|
|
||||||
));
|
|
||||||
human.openInventory(player.getEnderChest());
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
human.sendMessage(Component.text("This player is not online.").color(FAIL_COLOR));
|
human.sendMessage(Component.text("This player is not online.").color(FAIL_COLOR));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user