Open Lucky3028 opened 3 years ago
😢
[11:51:12 ERROR]: Could not pass event PlayerInteractEvent to ShulkerBoxBackPack
s v1.1.4
org.bukkit.event.EventException: null
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
va:306) ~[spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
a:62) ~[spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j
ava:500) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
ava:485) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at org.bukkit.craftbukkit.v1_12_R1.event.CraftEventFactory.callPlayerInt
eractEvent(CraftEventFactory.java:235) [spigot-1.12.2.jar:git-Spigot-79a30d7-acb
c348]
at org.bukkit.craftbukkit.v1_12_R1.event.CraftEventFactory.callPlayerInt
eractEvent(CraftEventFactory.java:202) [spigot-1.12.2.jar:git-Spigot-79a30d7-acb
c348]
at org.bukkit.craftbukkit.v1_12_R1.event.CraftEventFactory.callPlayerInt
eractEvent(CraftEventFactory.java:198) [spigot-1.12.2.jar:git-Spigot-79a30d7-acb
c348]
at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.jav
a:993) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.PacketPlayInBlockPlace.a(PacketPlayInBl
ockPlace.java:26) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.PacketPlayInBlockPlace.a(PacketPlayInBl
ockPlace.java:1) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.PlayerConnectionUtils$1.run(SourceFile:
13) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:51
1) [?:1.8.0_212]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_212
]
at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46) [spigot-1.
12.2.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:
748) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:
406) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:
679) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.jav
a:577) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
Caused by: java.lang.NullPointerException
at thirtyvirus.sbbp.MenuLoader.createShulkerBoxInventory(MenuLoader.java
:23) ~[?:?]
at thirtyvirus.sbbp.events.UseItem.onPlayerUse(UseItem.java:43) ~[?:?]
at sun.reflect.GeneratedMethodAccessor166.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43) ~[?:1.8.0_212]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_212]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
va:302) ~[spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
... 18 more
ガッ
CraftBukkit (CraftMetaItem.java
)の階層まで潜って調べたが、ItemMeta#getDisplayName
のnullabilityが不明確なので向こう側にSpigotがdisplayNameが存在するか確かめるお作法として推奨しているItemMeta#hasDisplayName
を使用するというPRを出す。
CraftMetaItem#hasDisplayName
は以下のような実装になっている:
public boolean hasDisplayName() {
return !Strings.isNullOrEmpty(this.displayName);
}
ここで、Strings
はcom.google.common.base.Strings
であり、Strings.isNullOrEmpty
はcom.google.common.base.Platform.stringIsNullOrEmpty
に委譲される。そしてPlatform.stringIsNullOrEmpty
は
boolean stringIsNullOrEmpty(@Nullable String string) {
return string == null || string.isEmpty();
}
と実装されており、よってCraftMetaItem#displayName
がnullableであると読める。
ということで、 https://github.com/ThirtyVirus/ShulkerBox_BackPacks/pull/2 としてPRを出したけど、何も反応がない
forkして、整地鯖側だけでとりあえずその修正して運用するっていうのはなしです?
ありです!
じゃ、そうします?
どのような方向性でもおkです (私としては)
(確かに) じゃ、やりましょ
よくコードを見たら、config.ymlのapi-versionが1.13になってて草 SpigotMCの対応バージョン間違っとるやんけ! https://github.com/GiganticMinecraft/ShulkerBox_BackPacks/blob/811454335c7e1da705bd9e2560ca0d8767922430/plugin.yml#L4
https://www.spigotmc.org/resources/shulkerbox-backpacks-1-11-1-14.61073/