Ir para conteúdo
  • 0

[Dev][Ajuda] Erro no menu em GUI


Pergunta

Postado

bem... fiz o 3 menus em GUI, nos quais 2 apenas funcionaram, o terceiro bugou

InventoryClickEvent: https://hastebin.com/poyewekeye.vbs
 

Void: https://hastebin.com/ubohalacuz.vbs

 

OBS:

- InventoryClickEvent tem @EventHandler e Instance de player (os outros 2 GUIs funcionam)

- O void pega o ID do gui VIPs (e ja fiz o teste)
- Ja fiz verificações https://hastebin.com/bisokozica.css[Console manda ERRO Na linha 3]

10 respostass a esta questão

Posts Recomendados

Postado

Erro?

talvez seja esse "e.getCurrentItem().getItemMeta().getDisplayName().toString()", passe para "e.getCurrentItem().getItemMeta().getDisplayName()"

Se não for, manda o erro .-.

Postado

Erro?

talvez seja esse "e.getCurrentItem().getItemMeta().getDisplayName().toString()", passe para "e.getCurrentItem().getItemMeta().getDisplayName()"

Se não for, manda o erro .-.


[19:46:59] [Server thread/ERROR]: Could not pass event InventoryClickEvent to MabaziShop v1.0.0
org.bukkit.event.EventException
	at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[Spigot.jar:git-Spigot-db6de12-18fbb24]
	at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[Spigot.jar:git-Spigot-db6de12-18fbb24]
	at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [Spigot.jar:git-Spigot-db6de12-18fbb24]
	at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [Spigot.jar:git-Spigot-db6de12-18fbb24]
	at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:1630) [Spigot.jar:git-Spigot-db6de12-18fbb24]
	at net.minecraft.server.v1_8_R3.PacketPlayInWindowClick.a(SourceFile:31) [Spigot.jar:git-Spigot-db6de12-18fbb24]
	at net.minecraft.server.v1_8_R3.PacketPlayInWindowClick.a(SourceFile:9) [Spigot.jar:git-Spigot-db6de12-18fbb24]
	at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [Spigot.jar:git-Spigot-db6de12-18fbb24]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_131]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_131]
	at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [Spigot.jar:git-Spigot-db6de12-18fbb24]
	at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715) [Spigot.jar:git-Spigot-db6de12-18fbb24]
	at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [Spigot.jar:git-Spigot-db6de12-18fbb24]
	at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [Spigot.jar:git-Spigot-db6de12-18fbb24]
	at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [Spigot.jar:git-Spigot-db6de12-18fbb24]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
Caused by: java.lang.NullPointerException
	at me.mabazi.platina.Main.clickInv(Main.java:164) ~[?:?]
	at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_131]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_131]
	at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[Spigot.jar:git-Spigot-db6de12-18fbb24]
	... 15 more
[19:47:14] [Server thread/INFO]: TioShadow issued server command: /shop
[19:47:22] [Server thread/FATAL]: Error executing task
java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 76, Size: 45
	at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_131]
	at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_131]
	at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:45) [Spigot.jar:git-Spigot-db6de12-18fbb24]
	at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715) [Spigot.jar:git-Spigot-db6de12-18fbb24]
	at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [Spigot.jar:git-Spigot-db6de12-18fbb24]
	at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [Spigot.jar:git-Spigot-db6de12-18fbb24]
	at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [Spigot.jar:git-Spigot-db6de12-18fbb24]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
Caused by: java.lang.IndexOutOfBoundsException: Index: 76, Size: 45
	at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_131]
	at java.util.ArrayList.get(Unknown Source) ~[?:1.8.0_131]
	at net.minecraft.server.v1_8_R3.Container.clickItem(Container.java:268) ~[Spigot.jar:git-Spigot-db6de12-18fbb24]
	at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:1635) ~[Spigot.jar:git-Spigot-db6de12-18fbb24]
	at net.minecraft.server.v1_8_R3.PacketPlayInWindowClick.a(SourceFile:31) ~[Spigot.jar:git-Spigot-db6de12-18fbb24]
	at net.minecraft.server.v1_8_R3.PacketPlayInWindowClick.a(SourceFile:9) ~[Spigot.jar:git-Spigot-db6de12-18fbb24]
	at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) ~[Spigot.jar:git-Spigot-db6de12-18fbb24]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_131]
	at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_131]
	at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) ~[Spigot.jar:git-Spigot-db6de12-18fbb24]
	... 5 more

Postado

O que tem na linha 164 da classe Main? Aparentemente você está tentando pegar um valor que não existe.

No segundo erro(IndexOutOfBoundsException), você está tentando pegar um elemento da ArrayList que não existe(Tentando Pegar: 76, Tamanho: 45)

Postado

O que tem na linha 164 da classe Main? Aparentemente você está tentando pegar um valor que não existe.

No segundo erro(IndexOutOfBoundsException), você está tentando pegar um elemento da ArrayList que não existe(Tentando Pegar: 76, Tamanho: 45)

Linha 164: e.getCursor().toString()

 

 

Postado

Linha 164: e.getCursor().toString()

 

 

Isso seria para retornar o item que o jogador clicou?

Tente verificar se o curso não é nullo.

if (e.getCursor() != null) {
   //Seu código aqui 
}
Guest LurionK
Postado
if (e.getCurrentItem().getItemMeta() !=null){
   if (e.getCurrentItem().getItemMeta().getDisplayName().equals("like")){
   
}
}

Tenta checar se o item tem realmente meta ou um nome custom

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