flinbein / PowerNBT

[MineCraft] Minecraft PowerNBT plugin
https://www.spigotmc.org/resources/powernbt.9098/
MIT License
39 stars 25 forks source link

Update for 1.13.1 #28

Closed tonydu51 closed 2 years ago

tonydu51 commented 6 years ago

on start all it's ok but we try to modify a value (to hand/entity/blocks...) that give us a message error said the value don't change we can't edit. so can you update ? thanks

DPOH-VAR commented 6 years ago

Spigot --rev 1.13.1 PowerNBT version 0.8.9.2 All works fine

Please attach your log file.

tonydu51 commented 6 years ago

nothing in my log only in game: nbt

DPOH-VAR commented 6 years ago

execute /nbt debug on before error

UPD: What is your version of server and plugin?

tonydu51 commented 6 years ago

so when i try to rename an item: `[PowerNBT] Exception on command: nbt

java.lang.RuntimeException: can not change value by query tag.display.Name

at me.dpohvar.powernbt.command.action.ActionEdit.execute(ActionEdit.java:42) ~[?:?]

at me.dpohvar.powernbt.command.CommandNBT.command(CommandNBT.java:101) ~[?:?]

at me.dpohvar.powernbt.command.Command.onCommand(Command.java:30) ~[?:?]

at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot-1.13.jar:git-Spigot-f6a273b-7a2f486]

at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[spigot-1.13.jar:git-Spigot-f6a273b-7a2f486]

at org.bukkit.craftbukkit.v1_13_R2.CraftServer.dispatchCommand(CraftServer.java:699) ~[spigot-1.13.jar:git-Spigot-f6a273b-7a2f486]

at net.minecraft.server.v1_13_R2.PlayerConnection.handleCommand(PlayerConnection.java:1646) ~[spigot-1.13.jar:git-Spigot-f6a273b-7a2f486]

at net.minecraft.server.v1_13_R2.PlayerConnection.a(PlayerConnection.java:1481) ~[spigot-1.13.jar:git-Spigot-f6a273b-7a2f486]

at net.minecraft.server.v1_13_R2.PacketPlayInChat.a(PacketPlayInChat.java:45) ~[spigot-1.13.jar:git-Spigot-f6a273b-7a2f486]

at net.minecraft.server.v1_13_R2.PacketPlayInChat.a(PacketPlayInChat.java:1) ~[spigot-1.13.jar:git-Spigot-f6a273b-7a2f486]

at net.minecraft.server.v1_13_R2.PlayerConnectionUtils.a(SourceFile:10) ~[spigot-1.13.jar:git-Spigot-f6a273b-7a2f486]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_72]

at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_72]

at net.minecraft.server.v1_13_R2.SystemUtils.a(SourceFile:199) [spigot-1.13.jar:git-Spigot-f6a273b-7a2f486]

at net.minecraft.server.v1_13_R2.MinecraftServer.b(MinecraftServer.java:900) [spigot-1.13.jar:git-Spigot-f6a273b-7a2f486]

at net.minecraft.server.v1_13_R2.DedicatedServer.b(DedicatedServer.java:417) [spigot-1.13.jar:git-Spigot-f6a273b-7a2f486]

at net.minecraft.server.v1_13_R2.MinecraftServer.a(MinecraftServer.java:835) [spigot-1.13.jar:git-Spigot-f6a273b-7a2f486]

at net.minecraft.server.v1_13_R2.MinecraftServer.run(MinecraftServer.java:733) [spigot-1.13.jar:git-Spigot-f6a273b-7a2f486]

at java.lang.Thread.run(Thread.java:745) [?:1.8.0_72]

Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: wrong number of arguments

at me.dpohvar.powernbt.utils.ReflectionUtils$RefMethod$RefExecutor.call(ReflectionUtils.java:692) ~[?:?]

at me.dpohvar.powernbt.utils.NBTUtils_Bukkit_raw.cloneTag(NBTUtils_Bukkit_raw.java:193) ~[?:?]

at me.dpohvar.powernbt.nbt.NBTBase.clone(NBTBase.java:146) ~[?:?]

at me.dpohvar.powernbt.utils.NBTQuery.set(NBTQuery.java:229) ~[?:?]

at me.dpohvar.powernbt.nbt.NBTContainer.setCustomTag(NBTContainer.java:83) ~[?:?]

at me.dpohvar.powernbt.command.action.ActionEdit.execute(ActionEdit.java:39) ~[?:?]

... 18 more

Caused by: java.lang.IllegalArgumentException: wrong number of arguments

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_72]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_72]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_72]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_72]

at me.dpohvar.powernbt.utils.ReflectionUtils$RefMethod$RefExecutor.call(ReflectionUtils.java:690) ~[?:?]

at me.dpohvar.powernbt.utils.NBTUtils_Bukkit_raw.cloneTag(NBTUtils_Bukkit_raw.java:193) ~[?:?]

at me.dpohvar.powernbt.nbt.NBTBase.clone(NBTBase.java:146) ~[?:?]

at me.dpohvar.powernbt.utils.NBTQuery.set(NBTQuery.java:229) ~[?:?]

at me.dpohvar.powernbt.nbt.NBTContainer.setCustomTag(NBTContainer.java:83) ~[?:?]

at me.dpohvar.powernbt.command.action.ActionEdit.execute(ActionEdit.java:39) ~[?:?]

... 18 more`
jb-aero commented 6 years ago

If it is any help, I've been making a plugin that uses your API, and this specifically is triggered by trying to work with items, even just reading them. I've been trying to resolve the issue myself, but I'm not understanding why it would be saying wrong number of arguments there. It looks to me that it is calling NBTBase.clone() with no arguments, but in the decompiled source that method does not take arguments.

Spigot 1.13.1 PowerNBT 0.8.9.2 Entry point: https://github.com/jb-aero/CHNBT/blob/master/src/main/java/io/github/jbaero/nbt/Utils.java#L343 Log: https://pastebin.com/7GHT61TR

AndreyVakhterovMB commented 6 years ago

If it is any help

Thank you! I will try to reproduce this error again

jb-aero commented 6 years ago

I have found the issue. findMethodByReturnType is finding the first method in NBTBase that returns NBTBase. This now finds NBTBase:createTag(byte) before NBTBase:clone(). I will see if I can fix this without breaking version independence.