A claim plugin based on FTB Chunks
at master 26 lines 949 B view raw
1package dev.keii.keiichunks.commands; 2 3import dev.keii.keiichunks.KeiiChunks; 4import dev.keii.keiichunks.inventories.InventoryMap; 5import net.kyori.adventure.text.Component; 6import net.kyori.adventure.text.format.NamedTextColor; 7import org.bukkit.command.Command; 8import org.bukkit.command.CommandExecutor; 9import org.bukkit.command.CommandSender; 10import org.bukkit.entity.Player; 11import org.jetbrains.annotations.NotNull; 12 13public class CommandMap implements CommandExecutor { 14 @Override 15 public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) { 16 if(!(sender instanceof Player player)) { 17 sender.sendMessage(Component.text("You must run this command as player!").color(NamedTextColor.RED)); 18 return false; 19 } 20 21 InventoryMap map = new InventoryMap(player); 22 player.openInventory(map.getInventory()); 23 24 return true; 25 } 26}