Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.elitios.elitiosplugins.commands;
- import com.elitios.elitiosplugins.ElitiosEssentials;
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.Material;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import org.bukkit.inventory.ItemStack;
- public class CommandMore implements CommandExecutor {
- @Override
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
- if (!(sender instanceof Player)) return true;
- if (args.length == 0) {
- final Player player = (Player) sender;
- final ItemStack item = player.getInventory().getItemInMainHand();
- if (player.hasPermission("me.more")) {
- if (item.getType() == Material.LEGACY_AIR || item.getType() == Material.AIR) {
- player.sendMessage(ElitiosEssentials.matouland + "§6Vous n'avez pas d'item dans votre main !");
- return false;
- // ---
- } else if (item.getType() == Material.COMMAND_BLOCK_MINECART || item.getType() == Material.COMMAND_BLOCK || item.getType() == Material.DEBUG_STICK) {
- player.sendMessage(ElitiosEssentials.matouland + "§6Vous ne pouvez pas stacker cette item");
- return false;
- }
- if (item.getAmount() == 64) {
- player.sendMessage(ElitiosEssentials.matouland + "§cL'item suivant est déjà à 64 exemplaire : §6" + item.getType().toString());
- return false;
- }
- item.setAmount(64);
- player.sendMessage(ElitiosEssentials.matouland + "§aVous venez de stacker l'item suivant : §6" + item.getType().toString());
- for (Player staff : Bukkit.getOnlinePlayers()) {
- if (staff.hasPermission("me.more.alert")) {
- staff.sendMessage("§7[" + ChatColor.DARK_GRAY + player.getName() + " §7a stack §8" + item.getType().toString() + "§7]");
- }
- }
- } else {
- player.sendMessage(ElitiosEssentials.matouland + "§cVous n'avez pas accès à cette commande !");
- }
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement