DevotedMC / Bastion

Minecraft plugin that allows players to place Citadel-reinforced blocks that stop block placement or enderpearl teleportation. Updated for Spigot 1.12
http://www.devotedmc.com
Other
2 stars 10 forks source link

on placement of a valid item + name match #21

Closed ProgrammerDan closed 7 years ago

ProgrammerDan commented 7 years ago
[01:35:19 ERROR]: Could not pass event BlockPlaceEvent to Bastion v2.0.2
org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.10.2.jar:git-Spigot-72c2605-251a5b6]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-1.10.2.jar:git-Spigot-72c2605-251a5b6]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot-1.10.2.jar:git-Spigot-72c2605-251a5b6]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot-1.10.2.jar:git-Spigot-72c2605-251a5b6]
        at org.bukkit.craftbukkit.v1_10_R1.event.CraftEventFactory.callBlockPlaceEvent(CraftEventFactory.java:146) [spigot-1.10.2.jar:git-Spigot-72c2605-251a5b6]
        at net.minecraft.server.v1_10_R1.ItemStack.placeItem(ItemStack.java:162) [spigot-1.10.2.jar:git-Spigot-72c2605-251a5b6]
        at net.minecraft.server.v1_10_R1.PlayerInteractManager.a(PlayerInteractManager.java:538) [spigot-1.10.2.jar:git-Spigot-72c2605-251a5b6]
        at net.minecraft.server.v1_10_R1.PlayerConnection.a(PlayerConnection.java:910) [spigot-1.10.2.jar:git-Spigot-72c2605-251a5b6]
        at net.minecraft.server.v1_10_R1.PacketPlayInUseItem.a(PacketPlayInUseItem.java:37) [spigot-1.10.2.jar:git-Spigot-72c2605-251a5b6]
        at net.minecraft.server.v1_10_R1.PacketPlayInUseItem.a(PacketPlayInUseItem.java:1) [spigot-1.10.2.jar:git-Spigot-72c2605-251a5b6]
        at net.minecraft.server.v1_10_R1.PlayerConnectionUtils$1.run(SourceFile:13) [spigot-1.10.2.jar:git-Spigot-72c2605-251a5b6]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_102]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_102]
        at net.minecraft.server.v1_10_R1.SystemUtils.a(SourceFile:45) [spigot-1.10.2.jar:git-Spigot-72c2605-251a5b6]
        at net.minecraft.server.v1_10_R1.MinecraftServer.D(MinecraftServer.java:732) [spigot-1.10.2.jar:git-Spigot-72c2605-251a5b6]
        at net.minecraft.server.v1_10_R1.DedicatedServer.D(DedicatedServer.java:400) [spigot-1.10.2.jar:git-Spigot-72c2605-251a5b6]
        at net.minecraft.server.v1_10_R1.MinecraftServer.C(MinecraftServer.java:668) [spigot-1.10.2.jar:git-Spigot-72c2605-251a5b6]
        at net.minecraft.server.v1_10_R1.MinecraftServer.run(MinecraftServer.java:567) [spigot-1.10.2.jar:git-Spigot-72c2605-251a5b6]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_102]
Caused by: java.lang.NullPointerException
        at isaac.bastion.storage.BastionBlockStorage.forLocation(BastionBlockStorage.java:224) ~[?:?]
        at isaac.bastion.manager.BastionBlockManager.getBlockingBastions(BastionBlockManager.java:233) ~[?:?]
        at isaac.bastion.manager.BastionBlockManager.shouldStopBlock(BastionBlockManager.java:145) ~[?:?]
        at isaac.bastion.listeners.BastionDamageListener.onBlockPlace(BastionDamageListener.java:50) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_102]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_102]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_102]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_102]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[spigot-1.10.2.jar:git-Spigot-72c2605-251a5b6]
        ... 18 more
ProgrammerDan commented 7 years ago

This is using the latest commit that just hit. Use the dependency set as described in the POM, these are (as of now) latest for civmodcore, namelayer

TealNerd commented 7 years ago

The only way this NPE could ever happen is if you loaded a world after bastion loaded all bastions

I'm like 99% sure

ProgrammerDan commented 7 years ago

What if the bastion database was simply empty? Would it ever create the "stub" StorageSet for the world?

TealNerd commented 7 years ago

yeah load iterates through Bukkit.getWorlds() and adds them to a Map<World, SparseQuadTree> with an empty SQT. as far as I can tell the SQT find method can't return null so the only thing that could be returning null is blocks.get(world) which also doesn't make sense

TealNerd commented 7 years ago

wait nevermind im dumb

ProgrammerDan commented 7 years ago

OH lol, ok. Happens :D