Does it mean the world is null or something? Part of Code, with "<<<<<<<<" pointing at source Code (Text): private void initStructure(final Land land) { //suspicious2 new BukkitRunnable(){ @Override public void run() { Structure structure = land.getStructure(); if(structure == null) return; if(structure.getLoc() == null) return; if(structure.getLoc().toLocation() == null) return; if(land.getOwner() == null){ Block block = structure.getLoc().toLocation().getBlock(); //<<<<<<<<< Error: Code (Text): [21:11:40 WARN]: [Kingdoms] Task #577 for Kingdoms v13.2.4 generated an exception java.lang.NullPointerException at org.bukkit.Location.getBlock(Location.java:87) ~[spigot-1.10.2.jar:git-Spigot-72c2605-251a5b6] at org.kingdoms.manager.game.StructureManager$SyncLoadTask$1.run(StructureManager.java:597) ~[?:?] at org.bukkit.craftbukkit.v1_10_R1.scheduler.CraftTask.run(CraftTask.java:71) ~[spigot-1.10.2.jar:git-Spigot-72c2605-251a5b6] at org.bukkit.craftbukkit.v1_10_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:353) [spigot-1.10.2.jar:git-Spigot-72c2605-251a5b6] at net.minecraft.server.v1_10_R1.MinecraftServer.D(MinecraftServer.java:723) [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(Unknown Source) [?:1.8.0_111]
So it doesn't return when you call structure.getLoc() so I'm assuming that's not what's null? Or does it? Because it wouldn't print that npe if it does because it returns
Have u tried printing out the location. If the location is null, the block will also technically be null.
Code (Java): if(structure.getLoc() == null) return; if(structure.getLoc().toLocation() == null) return;
The World object in Location is most certainly null. The above line is as followed: Code (Java): return world.getBlockAt(this); The only thing that can possibly be null is "world". The constructor for Location does not check if the provided World is null, so it is very likely that you accidentally retrieved a World by name that did not exist. Did no one else bother to take a look at Bukkit's source code? You know... the line that was outlined in the stacktrace? A lot of the answers in this thread are absurd and are just wild guesses. Please do a bit of research before actually replying. This thread could have been answered just under 2 hours ago
Ah sorry I had not noticed that. Anyway, I went throught the Spigot source and checked the getBlock method. Code (Text): public Block getBlock() { return world.getBlockAt(this); } So...... the only possible issue is, the world in the aquired Location object does not exist. EDIT: lol a guy beat me to this. RIP
Ok, thanks, I'll mark as solved. Anyway, where did you guys find the source? The links I google led me to the javadoc
All source code can be found on SpigotMC's Stash repository. This contains source code for CraftBukkit, Bukkit and Spigot, as well as various other projects such as plugin annotations and fernflower