Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- plugin.yml:
- name: Golden
- version: 1.0
- author: beyptitloup
- main: fr.beyptitloup.staff.Main
- commands:
- mod:
- description: Ceci est une command de mod
- permission: staff.mod.use
- eject:
- description: Ceci est une command de kick
- permission: staff.eject.use
- ss:
- description: Ceci est une command de moderation
- permission: staff.ss.use
- gm:
- description: Command pour ce mettre dans un mode survival, creatif, aventure, spectateur
- permission: admin.gamemode.use
- w:
- description: Command pour ce mettre dans un mode survival, creatif, aventure, spectateur
- permission: admin.weather.use
- telea:
- description: Command pour se teleport
- permission: admin.tpa.use
- telehere:
- description: Command pour se teleport
- permission: admin.tphere.use
- info:
- description: Command pour donne une information importante
- permission: admin.info.use
- dif:
- description: Command pour mettre a jour la difficulte du jeu
- permission: admin.df.use
- bannir:
- description: Command pour ban un joueur
- permission: admin.ban.use
- msg:
- description: Command pour envoyer un message privee a un joueur
- permission: player.msg.use
- aide:
- description: Command pour envoyer un message privee a un joueur
- permission: player.help.use
- health:
- description: Comand pour health un joueur
- permission: admin.health.use
- food:
- description: Command pour nourir un joueur
- permission: admin.food.use
- config.yml:
- messagejoin: " bienvenue sur GoldeBlaze serveur Mini Jeux!"
- Main.java:
- package fr.beyptitloup.staff;
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.plugin.java.JavaPlugin;
- import fr.beyptitloup.staff.commands.Command;
- import fr.beyptitloup.staff.commands.CommandAdmin;
- import fr.beyptitloup.staff.commands.CommandPlayer;
- import fr.beyptitloup.staff.listeners.Config;
- import fr.beyptitloup.staff.listeners.GoldenGuard;
- import fr.beyptitloup.staff.listeners.ListenersInventory;
- public class Main extends JavaPlugin{
- @Override
- public void onEnable() {
- saveDefaultConfig();
- //System.out.println("Le plugin Golden vien de s'allumer");
- colorStr("&6Le plugin golden vien de s'allumer");
- //Command Staff
- getCommand("mod").setExecutor(new Command(this));
- getCommand("eject").setExecutor(new Command(this));
- getCommand("ss").setExecutor(new Command(this));
- getCommand("bannir").setExecutor(new Command(this));
- //Command Admin
- getCommand("gm").setExecutor(new CommandAdmin(this));
- getCommand("w").setExecutor(new CommandAdmin(this));
- getCommand("telea").setExecutor(new CommandAdmin(this));
- getCommand("telehere").setExecutor(new CommandAdmin(this));
- getCommand("info").setExecutor(new CommandAdmin(this));
- getCommand("dif").setExecutor(new CommandAdmin(this));
- getCommand("health").setExecutor(new CommandAdmin(this));
- getCommand("food").setExecutor(new CommandAdmin(this));
- //Command Player
- getCommand("msg").setExecutor(new CommandPlayer(this));
- getCommand("aide").setExecutor(new CommandPlayer(this));
- //Listeners
- getServer().getPluginManager().registerEvents(new ListenersInventory(this), this);
- getServer().getPluginManager().registerEvents(new Config(this), this);
- getServer().getPluginManager().registerEvents(new GoldenGuard(this), this);
- }
- @Override
- public void onDisable() {
- //System.out.println("Le plugin Golden vien de s'eteindre");
- colorStr("&6Le plugin golden vien de s'eteindre");
- }
- public void colorStr(String string) {
- Bukkit.getConsoleSender().sendMessage(ChatColor.translateAlternateColorCodes('&', string));
- }
- }
- Command.java:
- package fr.beyptitloup.staff.commands;
- import java.util.ArrayList;
- import java.util.List;
- import org.bukkit.BanList;
- import org.bukkit.Bukkit;
- import org.bukkit.GameMode;
- import org.bukkit.Material;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.CommandSender;
- import org.bukkit.enchantments.Enchantment;
- import org.bukkit.entity.Player;
- import org.bukkit.inventory.Inventory;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.inventory.meta.ItemMeta;
- import fr.beyptitloup.staff.Main;
- import net.md_5.bungee.api.ChatColor;
- public class Command implements CommandExecutor {
- @SuppressWarnings("unused")
- private Main main;
- private List<String> mod = new ArrayList<>();
- public Command(Main main) {
- this.main = main;
- }
- @Override
- public boolean onCommand(CommandSender sender, org.bukkit.command.Command cmd, String msg, String[] args) {
- Player target = Bukkit.getPlayer(args[0]);
- if (sender instanceof Player) {
- Player player = (Player)sender;
- if(cmd.getName().equalsIgnoreCase("mod")) {
- if(!mod.contains(player.getName())){
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Vous êtes actuellement en /mod");
- player.getInventory().clear();
- ItemStack sword = new ItemStack(Material.WOOD_SWORD, 1); //Epée kb1
- ItemStack sword2 = new ItemStack(Material.WOOD_SWORD, 1); //Epée kb 2
- ItemStack cps = new ItemStack(Material.COMPASS, 1); //Détection cps
- ItemMeta swordM = sword.getItemMeta();
- ItemMeta swordM2 = sword2.getItemMeta();
- ItemMeta cpsM = cps.getItemMeta();
- swordM.setDisplayName("§4Epée KB 1");
- swordM2.setDisplayName("§4Epée KB 2");
- cpsM.setDisplayName("§9CPS");
- swordM.addEnchant(Enchantment.KNOCKBACK, 1, true);
- swordM2.addEnchant(Enchantment.KNOCKBACK, 2, true);
- sword.setItemMeta(swordM);
- sword2.setItemMeta(swordM2);
- cps.setItemMeta(cpsM);
- player.setGameMode(GameMode.CREATIVE);
- player.getInventory().setItem(2, sword);
- player.getInventory().setItem(3, sword2);
- player.getInventory().setItem(5, cps);
- mod.add(player.getName());
- } else {
- player.getInventory().clear();
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Vous n'êtes plus actuellement en /mod");
- player.setGameMode(GameMode.CREATIVE);
- mod.remove(player.getName());
- }
- }
- if(cmd.getName().equalsIgnoreCase("eject")) {
- if (target == null) {
- sender.sendMessage("§6[Golden-->§4ERREUR§6]" + ChatColor.GRAY + "7Le joueur n'est pas connecté");
- }
- Bukkit.broadcastMessage("Le joueur " + target.getName() + "s'est fais kick pour " + args[1] + " " + args[2]);
- target.kickPlayer("§7Vous avez été kick pour §e\n " + args[1] + " " + args[2]);
- return true;
- }
- if(cmd.getName().equalsIgnoreCase("ss")) {
- Inventory ss = Bukkit.createInventory(null, 36, "§8Menu de Sanction");
- ss.setItem(11, getItem(Material.DIRT, "§6Sanction GamePlay"));
- ss.setItem(10, getItem(Material.IRON_AXE, "§6Sanction Tricherie"));
- ss.setItem(9, getItem(Material.PAPER, "§6Sanction Messagerie"));
- ss.setItem(0, getItem(Material.ANVIL, "§e" + target.getName()));
- player.openInventory(ss);
- }
- if(cmd.getName().equalsIgnoreCase("bannir")) {
- Player plrtarget = Bukkit.getPlayer(args[0]);
- String reason = args[1] + " " + args[2] + " " + args[3];
- if(reason == "" || reason == null) {
- player.sendMessage("§6[Golden-->§4ERREUR§6]" + ChatColor.GRAY + "Veuillez mettre un raison");
- }
- Bukkit.getBanList(BanList.Type.NAME).addBan(args[0], reason, null, sender.getName());
- plrtarget.kickPlayer(ChatColor.GRAY + "Tu a été banni du serveur pour §c" + reason);
- return true;
- }
- }
- return false;
- }
- public static ItemStack getItem(Material material, String name) {
- ItemStack it = new ItemStack(material, 1);
- ItemMeta itM = it.getItemMeta();
- itM.setDisplayName(name);
- it.setItemMeta(itM);
- return it;
- }
- }
- CommandAdmin.java:
- package fr.beyptitloup.staff.commands;
- import org.bukkit.Bukkit;
- import org.bukkit.Difficulty;
- import org.bukkit.GameMode;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import fr.beyptitloup.staff.Main;
- import net.md_5.bungee.api.ChatColor;
- public class CommandAdmin implements CommandExecutor {
- @SuppressWarnings("unused")
- private Main main;
- public CommandAdmin(Main main) {
- this.main = main;
- }
- @Override
- public boolean onCommand(CommandSender sender, Command cmd, String msg, String[] args) {
- if(sender instanceof Player) {
- Player player = (Player) sender;
- if(cmd.getName().equalsIgnoreCase("gm")) {
- switch(args[0]) {
- default:
- sender.sendMessage("§6[Golden-->§4ERREUR§6]" + ChatColor.GRAY + "Mettez comme argument sois 1 ou 2 ou 3 ou 0");
- break;
- case "1":
- player.setGameMode(GameMode.CREATIVE);
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Vous êtes en mode §cCréatif");
- break;
- case "2":
- player.setGameMode(GameMode.ADVENTURE);
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Vous êtes en mode §cAventure");
- break;
- case "3":
- player.setGameMode(GameMode.SPECTATOR);
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Vous êtes en mode §cSpectateur");
- break;
- case "0":
- player.setGameMode(GameMode.SURVIVAL);
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Vous êtes en mode §cSurvival");
- break;
- case "creatif":
- player.setGameMode(GameMode.CREATIVE);
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Vous êtes en mode §cCréatif");
- break;
- case "adventure":
- player.setGameMode(GameMode.ADVENTURE);
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Vous êtes en mode §cAventure");
- break;
- case "specator":
- player.setGameMode(GameMode.SPECTATOR);
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Vous êtes en mode §cSpectateur");
- break;
- case "survival":
- player.setGameMode(GameMode.SURVIVAL);
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Vous êtes en mode §cSurvival");
- break;
- }
- return true;
- }
- if(cmd.getName().equalsIgnoreCase("w")) {
- switch(args[0]) {
- default:
- player.sendMessage("§6[Golden-->§4ERREUR§6]" + ChatColor.GRAY + "Mettez comme argument : c/clear ou r/rain ou t/thunder | pour le temp : night or day ou n ou d");
- break;
- case "c":
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Le temps à été §cenlever");
- player.performCommand("weather clear");
- break;
- case "clear":
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Le temps à été §cenlever");
- player.performCommand("weather clear");
- break;
- case "r":
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Le temps à été mis sur §cpluie");
- player.performCommand("weather rain");
- break;
- case "rain":
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Le temps à été mis sur §cpluie");
- player.performCommand("weather rain");
- break;
- case "thunder":
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Le temps à été mis sur §ctempête");
- player.performCommand("weather thunder");
- break;
- case "t":
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Le temps à été mis sur §ctempête");
- player.performCommand("weather thunder");
- break;
- case "n":
- player.performCommand("time set night");
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Il fait nuit");
- break;
- case "night":
- player.performCommand("time set night");
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "7Il fait nuit");
- break;
- case "d":
- player.performCommand("time set day");
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Il fait jour");
- break;
- case "day":
- player.performCommand("time set day");
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Il fait jour");
- break;
- }
- return true;
- }
- if(cmd.getName().equalsIgnoreCase("telea")) {
- Player target = Bukkit.getPlayer(args[0]);
- String t = args[0];
- if(target == null) {
- player.sendMessage("§6[Golden-->§4ERREUR§6]" + ChatColor.GRAY + "le joueur est introuvable / hors ligne");
- return true;
- }
- if(t.length() <= 0) {
- player.sendMessage("§6[Golden-->§4ERREUR§6]" + ChatColor.GRAY + "le joueur est introuvable / hors ligne");
- return true;
- }
- player.performCommand("tp " + target.getName());
- player.sendMessage("§6[Golden] §7Vous vous êtes fais téléporter");
- return true;
- }
- if(cmd.getName().equalsIgnoreCase("telehere")) {
- Player target = Bukkit.getPlayer(args[0]);
- String t = args[0];
- if(target == null) {
- player.sendMessage("§6[Golden-->§4ERREUR§6]" + ChatColor.GRAY + "le joueur est introuvable / hors ligne");
- return true;
- }
- if(t.length() <= 0) {
- player.sendMessage("§6[Golden-->§4ERREUR§6]" + ChatColor.GRAY + "le joueur est introuvable / hors ligne");
- return true;
- }
- player.performCommand("tp " + target.getName() + " " + player.getName());
- player.sendMessage("§6[Golden] §7Vous vous êtes fais téléporter");
- return true;
- }
- if(cmd.getName().equalsIgnoreCase("info")) {
- StringBuilder info = new StringBuilder();
- for(String part : args) {
- info.append(part + " ");
- }
- Bukkit.broadcastMessage("§6[Golden-->§cINFO§6] §e" + info.toString());
- }
- if(cmd.getName().equalsIgnoreCase("dif")) {
- switch(args[0]) {
- default:
- player.sendMessage("§6[Golden-->§4ERREUR§6] §7Mettez comme argument : peaceful, hard, normal, easy ou p, h, n, e ou aucun, difficile, normale, facile");
- break;
- case "peaceful":
- player.getWorld().setDifficulty(Difficulty.PEACEFUL);
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Vous avez mis sur la difficulté §cpeaceful");
- break;
- case "p":
- player.getWorld().setDifficulty(Difficulty.PEACEFUL);
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Vous avez mis sur la difficulté §cpeaceful");
- break;
- case "aucun":
- player.getWorld().setDifficulty(Difficulty.PEACEFUL);
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Vous avez mis sur la difficulté §cpeaceful");
- break;
- case "hard":
- player.getWorld().setDifficulty(Difficulty.HARD);
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Vous avez mis sur la difficulté §chard");
- break;
- case "h":
- player.getWorld().setDifficulty(Difficulty.HARD);
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Vous avez mis sur la difficulté §chard");
- break;
- case "difficile":
- player.getWorld().setDifficulty(Difficulty.HARD);
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Vous avez mis sur la difficulté §chard");
- break;
- case "normal":
- player.getWorld().setDifficulty(Difficulty.NORMAL);
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Vous avez mis sur la difficulté §cnormal");
- break;
- case "n":
- player.getWorld().setDifficulty(Difficulty.NORMAL);
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Vous avez mis sur la difficulté §cnormal");
- break;
- case "normale":
- player.getWorld().setDifficulty(Difficulty.NORMAL);
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Vous avez mis sur la difficulté §cnormal");
- break;
- case "easy":
- player.getWorld().setDifficulty(Difficulty.EASY);
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Vous avez mis sur la difficulté §ceasy");
- break;
- case "e":
- player.getWorld().setDifficulty(Difficulty.EASY);
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Vous avez mis sur la difficulté §ceasy");
- break;
- case "facile":
- player.getWorld().setDifficulty(Difficulty.EASY);
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + "Vous avez mis sur la difficulté §ceasy");
- break;
- }
- return true;
- }
- if(cmd.getName().equalsIgnoreCase("health")) {
- Player target = Bukkit.getPlayer(args[0]);
- Player plr = (Player) sender;
- if(target != null) {
- sender.sendMessage("§6[Golden]" + ChatColor.GRAY + " Vous avez health " + target.getName());
- target.setHealth(100);
- return true;
- } else {
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + " Vous vous êtes health ");
- plr.setHealth(100);
- }
- return true;
- }
- if(cmd.getName().equalsIgnoreCase("food")) {
- Player target = Bukkit.getPlayer(args[0]);
- if(target == null) {
- player.sendMessage("§6[Golden-->§4ERREUR§6] §7Veuillez spécifier une joueur");
- return true;
- }
- if(target != null) {
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + " Vous avez mis à fond la nourriture à " + target.getName());
- target.setFoodLevel(20);
- }
- return true;
- }
- }
- return false;
- }
- }
- CommandPlayer.java
- package fr.beyptitloup.staff.commands;
- import java.util.StringJoiner;
- import org.bukkit.Bukkit;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import fr.beyptitloup.staff.Main;
- import net.md_5.bungee.api.ChatColor;
- public class CommandPlayer implements CommandExecutor {
- @SuppressWarnings("unused")
- private Main main;
- public CommandPlayer(Main main) {
- this.main = main;
- }
- @Override
- public boolean onCommand(CommandSender sender, Command cmd, String msg, String[] args) {
- if(cmd.getName().equalsIgnoreCase("msg")) {
- Player target = Bukkit.getPlayer(args[0]);
- Player player = (Player) sender;
- if (args.length == 0) {
- sender.sendMessage("§6[Golden-->§4ERREUR§6]" + ChatColor.GRAY + "7Le joueur est hors ligne / introuvable");
- return true;
- }
- @SuppressWarnings("unused")
- String arg$0 = args[0];
- if (args.length < 2) {
- sender.sendMessage("§6[Golden-->§4ERREUR§6]" + ChatColor.GRAY + "7Le joueur est hors ligne / introuvable");
- return true;
- }
- StringJoiner joiner = new StringJoiner(" ");
- for (int i = 1; i < args.length; i++) {
- joiner.add(args[i]);
- }
- System.out.println(joiner.toString());
- target.sendMessage("§6[Golden-->MP]" + "§e De: " + ChatColor.DARK_RED + sender.getName() + "§e à " + ChatColor.DARK_RED + target.getName() + ChatColor.GRAY + " " + joiner.toString());
- player.sendMessage("§6[Golden-->MP]" + "§e Vous: " + ChatColor.DARK_RED + sender.getName() + "§e à " + ChatColor.DARK_RED + target.getName() + ChatColor.GRAY + " " + joiner.toString());
- return true;
- }
- if(cmd.getName().equalsIgnoreCase("aide")) {
- Player player = (Player) sender;
- player.sendMessage("§6[Golden]" + ChatColor.GRAY + " Voici la listes des commandes :" + ChatColor.YELLOW + "\n - /msg <player> <message> \n - /aide ");
- }
- return false;
- }
- }
- Config.java:
- package fr.beyptitloup.staff.listeners;
- import org.bukkit.Bukkit;
- import org.bukkit.GameMode;
- import org.bukkit.entity.Player;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.EventPriority;
- import org.bukkit.event.Listener;
- import org.bukkit.event.player.PlayerJoinEvent;
- import fr.beyptitloup.staff.Main;
- public class Config implements Listener {
- private Main main;
- public Config(Main main) {
- this.main = main;
- }
- @EventHandler(priority = EventPriority.HIGHEST)
- public void onPlayerJoin(PlayerJoinEvent event) {
- Player player = event.getPlayer();
- if(player.isOp()) {
- event.setJoinMessage("§c"+ player.getName()+ "§6" + main.getConfig().getString("messagejoin"));
- player.setGameMode(GameMode.ADVENTURE);
- Bukkit.broadcastMessage("§6[Golden-->§4JoinAdmin§6]§7 le joueur §c" + player.getName() + " §7à rejoint le serveur !");
- }else{
- event.setJoinMessage("§c"+ player.getName()+ "§6" + main.getConfig().getString("messagejoin"));
- player.setGameMode(GameMode.ADVENTURE);
- }
- }
- }
- GoldenGuard.java:
- package fr.beyptitloup.staff.listeners;
- import org.bukkit.Bukkit;
- import org.bukkit.entity.Player;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.entity.EntityDamageByEntityEvent;
- import org.bukkit.event.player.PlayerMoveEvent;
- import fr.beyptitloup.staff.Main;
- public class GoldenGuard implements Listener {
- @SuppressWarnings("unused")
- private Main main;
- public GoldenGuard(Main main) {
- this.main = main;
- }
- @EventHandler
- public void onFly(PlayerMoveEvent event) {
- Player target = event.getPlayer();
- if(target.hasPermission("staff.ss.use") || target.hasPermission("ss.mod.use") || target.hasPermission("ss.eject.use")) {
- if(target.isFlying()) {
- Bukkit.broadcastMessage("Le joueur" + target.getName() + " à été détecter par §6[GoldenGuard]§f pour Fly !");
- }
- if(target.getAllowFlight()) {
- Bukkit.broadcastMessage("Le joueur" + target.getName() + " à été détecter par §6[GoldenGuard]§f pour Fly !");
- }
- if(event.getTo().getY() - event.getFrom().getY() >= 2) {
- Bukkit.broadcastMessage("Le joueur" + target.getName() + " à été détecter par §6[GoldenGuard]§f pour Fly !");
- }
- }
- }
- @EventHandler
- public void Reach(EntityDamageByEntityEvent event) {
- Player attacker = (Player) event.getDamager();
- Player victim = (Player) event.getEntity();
- if(attacker.getLocation().distance(victim.getLocation()) >= 4) {
- Bukkit.broadcastMessage("Le joueur" + attacker.getName() + " à été détecter par §6[GoldenGuard]§f pour Reach !");
- }
- }
- }
- ListenersInventory.java:
- package fr.beyptitloup.staff.listeners;
- import org.bukkit.Bukkit;
- import org.bukkit.Material;
- import org.bukkit.entity.Player;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.inventory.InventoryClickEvent;
- import org.bukkit.inventory.Inventory;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.inventory.meta.ItemMeta;
- import fr.beyptitloup.staff.Main;
- import net.md_5.bungee.api.ChatColor;
- public class ListenersInventory implements Listener {
- @SuppressWarnings("unused")
- private Main main;
- public ListenersInventory(Main main) {
- this.main = main;
- }
- @EventHandler
- public void onClick(InventoryClickEvent event) {
- Inventory inv = event.getInventory();
- Player player = (Player) event.getWhoClicked();
- String plr = inv.getItem(0).getItemMeta().getDisplayName();
- Player target = Bukkit.getPlayer(ChatColor.stripColor(inv.getItem(0).getItemMeta().getDisplayName()));;
- if(plr == null) {
- return;
- }
- ItemStack current = event.getCurrentItem();
- if(player.getOpenInventory().getTitle().equalsIgnoreCase("§8Menu de Sanction")) {
- if(current.getType() == Material.PAPER) {
- event.setCancelled(true);
- player.sendMessage("§6[GOLDENG]" + ChatColor.GRAY + "Vous ouvrez le menu §e§oSanction Messagerie");
- inv.setItem(0, getItem(Material.ANVIL, "§e" + plr));
- inv.setItem(9, new ItemStack(Material.AIR));
- inv.setItem(10, new ItemStack(Material.AIR));
- inv.setItem(11, new ItemStack(Material.AIR));
- inv.setItem(12, new ItemStack(Material.AIR));
- inv.setItem(13,new ItemStack(Material.AIR));
- inv.setItem(14,new ItemStack(Material.AIR));
- inv.setItem(15,new ItemStack(Material.AIR));
- inv.setItem(16,new ItemStack(Material.AIR));
- inv.setItem(17,new ItemStack(Material.AIR));
- inv.setItem(18,new ItemStack(Material.AIR));
- inv.setItem(9,getItem(Material.PUMPKIN, "§ePropos Interdit"));
- inv.setItem(10,getItem(Material.BANNER, "§ePub Mp"));
- inv.setItem(11,getItem(Material.GOLDEN_APPLE, "§eLanguage"));
- inv.setItem(12,getItem(Material.COOKED_FISH, "§eVantardise"));
- inv.setItem(13,getItem(Material.RAW_CHICKEN, "§eProvocation"));
- inv.setItem(14,getItem(Material.GOLDEN_CARROT, "§eInsulte"));
- inv.setItem(15,getItem(Material.BEETROOT_SOUP, "§eMenace de DDOS/DOX/HACK"));
- inv.setItem(16,getItem(Material.IRON_INGOT, "§eSpam"));
- inv.setItem(17,getItem(Material.DIAMOND_HOE, "§eFlood"));
- }
- if(current.getType() == Material.IRON_AXE) {
- event.setCancelled(true);
- player.sendMessage("§6[GOLDEN]" + ChatColor.GRAY + "Vous ouvrez le menu §e§oSanction Tricherie");
- inv.setItem(0, getItem(Material.ANVIL, "§e" + plr));
- inv.setItem(9, new ItemStack(Material.AIR) );
- inv.setItem(10, new ItemStack(Material.AIR) );
- inv.setItem(11, new ItemStack(Material.AIR) );
- inv.setItem(12, new ItemStack(Material.AIR) );
- inv.setItem(13,new ItemStack(Material.AIR));
- inv.setItem(14,new ItemStack(Material.AIR));
- inv.setItem(15,new ItemStack(Material.AIR));
- inv.setItem(16,new ItemStack(Material.AIR));
- inv.setItem(17,new ItemStack(Material.AIR));
- inv.setItem(18,new ItemStack(Material.AIR));
- inv.setItem(10, getItem(Material.DIAMOND_AXE, "§eAimBot"));
- inv.setItem(11, getItem(Material.GOLDEN_CARROT, "§eForceField / KillAura"));
- inv.setItem(12, getItem(Material.WEB, "§eAnti Knockback"));
- inv.setItem(13, getItem(Material.DIAMOND_SWORD, "§eFly / Speed"));
- inv.setItem(14, getItem(Material.SHIELD, "§eCPS§o§7(au dessus de 15)"));
- inv.setItem(15, getItem(Material.BOW, "§eReach"));
- inv.setItem(16, getItem(Material.LAVA_BUCKET, "§eAutres"));
- }
- //Sanction GamePlay
- if(current.getType() == Material.DIRT) {
- event.setCancelled(true);
- player.sendMessage("§6[GOLDEN]" + ChatColor.GRAY + "Vous ouvrez le menu §e§oSanction GamePlay");
- inv.setItem(0, getItem(Material.ANVIL, "§e" + plr));
- inv.setItem(9, new ItemStack(Material.AIR));
- inv.setItem(10, new ItemStack(Material.AIR));
- inv.setItem(11, new ItemStack(Material.AIR));
- inv.setItem(12, new ItemStack(Material.AIR));
- inv.setItem(13,new ItemStack(Material.AIR));
- inv.setItem(14,new ItemStack(Material.AIR));
- inv.setItem(15,new ItemStack(Material.AIR));
- inv.setItem(16,new ItemStack(Material.AIR));
- inv.setItem(17,new ItemStack(Material.AIR));
- inv.setItem(18,new ItemStack(Material.AIR));
- inv.setItem(10, getItem(Material.COBBLESTONE, "§eSkin Incorrect"));
- inv.setItem(11, getItem(Material.NAME_TAG, "§eNom Incorrect"));
- inv.setItem(12, getItem(Material.SHEARS, "§eAliances Solo/Equipe"));
- inv.setItem(13, getItem(Material.STONE, "§eConstruction Incorrect"));
- inv.setItem(14, getItem(Material.IRON_PICKAXE, "§eAnti Jeu"));
- inv.setItem(15, getItem(Material.FLINT, "§eAutre GamePlay"));
- }
- if(current.getType() == Material.ANVIL) {
- event.setCancelled(true);
- }
- if(current.getType() == Material.COBBLESTONE) {
- player.performCommand("eject " + target.getName() + " Skin Incorrecte");
- event.setCancelled(true);
- }
- if(current.getType() == Material.NAME_TAG) {
- player.performCommand("eject " + target.getName() + " Nom Incorrecte");
- event.setCancelled(true);
- }
- if(current.getType() == Material.SHEARS) {
- player.performCommand("eject " + target.getName() + " Alisances Solo/Equipe");
- event.setCancelled(true);
- }
- if(current.getType() == Material.STONE) {
- player.performCommand("eject " + target.getName() + " Construction Incorrect");
- event.setCancelled(true);
- }
- if(current.getType() == Material.IRON_PICKAXE) {
- player.performCommand("eject " + target.getName() + " Anti Jeu");
- event.setCancelled(true);
- }
- if(current.getType() == Material.FLINT) {
- player.performCommand("eject " + target.getName() + " Autres GamePlay");
- event.setCancelled(true);
- }
- if(current.getType() == Material.DIAMOND_AXE) {
- event.setCancelled(true);
- player.performCommand("bannir " + target.getName() + " Aimbot");
- }
- if(current.getType() == Material.GOLDEN_CARROT) {
- event.setCancelled(true);
- player.performCommand("bannir " + target.getName() + " ForceField / KillAura");
- }
- if(current.getType() == Material.WEB) {
- event.setCancelled(true);
- player.performCommand("bannir " + target.getName() + " Anti Knockback");
- }
- if(current.getType() == Material.DIAMOND_SWORD) {
- event.setCancelled(true);
- player.performCommand("bannir " + target.getName() + " Fly / Speed");
- }
- if(current.getType() == Material.BOW) {
- event.setCancelled(true);
- player.performCommand("bannir " + target.getName() + " Fly / Speed");
- }
- if(current.getType() == Material.LAVA_BUCKET) {
- event.setCancelled(true);
- player.performCommand("bannir " + target.getName() + " Autres");
- }
- }
- }
- public ItemStack getItem(Material material, String name) {
- ItemStack it = new ItemStack(material, 1);
- ItemMeta itM = it.getItemMeta();
- itM.setDisplayName(name);
- it.setItemMeta(itM);
- return it;
- }
- }
Add Comment
Please, Sign In to add comment