Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void quandoInteragirOsItensComUmJogador(PlayerInteractEntityEvent e) {
- if (((e.getPlayer() instanceof Player)) && ((e.getRightClicked() instanceof Player))) {
- Player p = e.getPlayer();
- Player p1 = (Player) e.getRightClicked();
- ItemStack item = p.getItemInHand();
- String pp, invs, padrao, ban;
- int id1, id3;
- pp = p.getName();
- padrao = "StaffMode.Itens.";
- invs = padrao + "Inventario.";
- ban = padrao + "Ban.";
- id1 = cnf.getInt(invs + "ID");
- id3 = cnf.getInt(ban + "ID");
- if (staffmode.contains(pp)) {
- if (item.getTypeId() == id1) {
- if (cnf.getBoolean(invs + "Ativar") == true) {
- p.openInventory(KwMetodos.getInv(p1));
- } else {
- p.chat("/openinv " + p1.getName());
- }
- return;
- }
- if (item.getTypeId() == id3) {
- p.openInventory(KwUtils.getInv(p1));
- return;
- }
- }
- }
- }
- @EventHandler
- public void quandoRemover(InventoryClickEvent e) {
- if (e.getWhoClicked() instanceof Player) {
- Player p = (Player) e.getWhoClicked();
- String pp = p.getName();
- Inventory inv, invs, inve;
- ItemStack i = e.getCurrentItem();
- invs = e.getInventory();
- inv = Bukkit.getServer().createInventory(null, cnf.getInt("StaffMode.Itens.Inventario.Tamanho"),
- KwMetodos.getReplaced("StaffMode.Itens.Inventario.Nome_Inv"));
- inve = Bukkit.getServer().createInventory(null, cnf.getInt("StaffMode.Itens.Ban.GUI.Tamanho"),
- KwMetodos.getReplaced("StaffMode.Itens.Ban.GUI.Nome"));
- String s, h, o, n, d, cmd1, cmd2, cmd3, cmd4;
- s = "StaffMode.Itens.Ban.Itens.";
- h = s + "Hacker.";
- int id1, id2, id3, id4;
- id1 = cnf.getInt(h + "ID");
- if (staffmode.contains(pp)) {
- if (invs.getName().equalsIgnoreCase(inv.getName())) {
- e.setCancelled(true);
- }
- if (invs.getName().equalsIgnoreCase(inve.getName())) {
- if (i != null) {
- if (i.getTypeId() == id1) {
- cmd1 = cnf.getString(h + "Comando").replace("{p}", p.getName());
- m.dispatchCommand(p, cmd1);
- return;
- }
- e.setCancelled(true);
- } else {
- e.setCancelled(true);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment