Ir para conteúdo

Alguem Me Ajuda?


Alquimia-X

Posts Recomendados

CODER</>
package zMr.Gui;
 
import java.util.ArrayList;
 
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
 
public class kitGui implements Listener{
 
private void setarinv(String perm, Inventory inv, Player p, Material item, int quantidade, int data, String nome, String descricao, int slot){
if(p.hasPermission("kit." + perm)){
ItemStack icone = new ItemStack(item, quantidade, (short)data);
ItemMeta iconem = icone.getItemMeta();
iconem.setDisplayName(nome);
ArrayList<String> lore = new ArrayList<String>();
lore.add(descricao);
iconem.setLore(lore);
icone.setItemMeta(iconem);
 
inv.setItem(slot, icone);
}
}
private void Gui(Player p){
Inventory inv = Bukkit.createInventory(p, 54,"§d§lKits:");
 
ItemStack icone = new ItemStack(Material.STAINED_GLASS);
ItemMeta iconem = icone.getItemMeta();
iconem.setDisplayName(" ");
icone.setItemMeta(iconem);
icone.setAmount(0);
 
setarinv("pvp", inv, p, Material.STONE_SWORD, 1, 0,"§aPvP", "§b[§7+§b] §7Kit Basico sem Efeitos, apenas Sopa e seu set!", 10);
for (int i = 0; i < 54; i++){
inv.addItem(icone);
}
p.openInventory(inv);
}
@EventHandler
private void clicarbau(PlayerInteractEvent e){
Player p = e.getPlayer();
if((e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) && p.getItemInHand().getType() == Material.ENDER_CHEST) {
Gui(p);
p.playSound(p.getLocation(), Sound.LEVEL_UP, 1.0F, 1.0F );
e.setCancelled(true);
}
@EventHandler
private void clicarinv(InventoryClickEvent e){
Player p = (Player) e.getWhoClicked();
 
if(e.getInventory().getName().equalsIgnoreCase("§dKits:")){
if(e.getCurrentItem() == null){
e.setCancelled(true);
return;
}
if(e.getCurrentItem().getType() == Material.STAINED_GLASS){
e.setCancelled(true);
return;
}
p.chat("/kits" + ChatColor.stripColor(e.getCurrentItem().getItemMeta().getDisplayName()));
p.closeInventory();
e.setCancelled(true);
}
}
 
}
 


ERRO</>

15:33:56 [sEVERE] Could not pass event PlayerInteractEvent to zMrKits v1.0
org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
        at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:30)
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:478)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:463)
        at org.bukkit.craftbukkit.v1_5_R3.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:207)
        at org.bukkit.craftbukkit.v1_5_R3.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:177)
        at net.minecraft.server.v1_5_R3.PlayerConnection.a(PlayerConnection.java:617)
        at net.minecraft.server.v1_5_R3.Packet15Place.handle(SourceFile:58)
        at org.spigotmc.netty.NettyNetworkManager.b(NettyNetworkManager.java:215)
        at net.minecraft.server.v1_5_R3.PlayerConnection.d(PlayerConnection.java:115)
        at net.minecraft.server.v1_5_R3.ServerConnection.b(SourceFile:35)
        at org.spigotmc.MultiplexingServerConnection.b(MultiplexingServerConnection.java:72)
        at net.minecraft.server.v1_5_R3.MinecraftServer.r(MinecraftServer.java:583)
        at net.minecraft.server.v1_5_R3.DedicatedServer.r(DedicatedServer.java:227)
        at net.minecraft.server.v1_5_R3.MinecraftServer.q(MinecraftServer.java:472)
        at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:404)
        at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573)
Caused by: java.lang.NoSuchFieldError: STAINED_GLASS
        at zMr.Gui.kitGui.Gui(kitGui.java:37)
        at zMr.Gui.kitGui.clicarbau(kitGui.java:53)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425)
        ... 17 more
Link para o comentário
Compartilhar em outros sites

Voce deve ter adicionado algum tipo de " Vidro " no GUI que pode esta dando conflito com outro plugin ou ate mesmo com o propio GUI

já Resolvi mais nao sei da resolvido no Tópico, o Erro era porque eu tava Abrindo na versão 1.5.2 sen que o STAINED_GLASS_PANE e 1.7.2

Editado por zMrRaiden2.0
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...