tastybento / ASkyBlock-Bugs-N-Features

Bug Tracker for ASkyBlock and AcidIsland - note team is 100% working on next version BentoBox
6 stars 3 forks source link

NullPointerException approved by clip #343

Closed Fuizziy closed 7 years ago

Fuizziy commented 7 years ago

Hello there

The error is not from Scoreboard, nore from PlaceHolderAPI (I tried to discuss with him, here is what he said http://prntscr.com/fw0w56 )

[16:31:30 ERROR]: [AnimatedNames] Error in placeholder: {askyblock_team_leader_name} [16:31:30 ERROR]: [AnimatedNames] java.lang.NullPointerException at com.wasteofplastic.askyblock.ASkyBlockAPI.getTeamLeader(ASkyBlockAPI.java:153) at be.maximvdw.animatednamescore.placeholders.a$5.a(ASkyblockPlaceholder.java:89) at be.maximvdw.animatednamescore.placeholders.a$5.getResult(ASkyblockPlaceholder.java:84) at be.maximvdw.animatednamescore.placeholders.Placeholder$20.a(Placeholder.java:1813) at be.maximvdw.animatednamescore.placeholders.Placeholder$20.getResult(Placeholder.java:1809) at be.maximvdw.animatednamescore.placeholders.PlaceholderReplacer.getResult(PlaceholderReplacer.java:57) at be.maximvdw.animatednamescore.placeholders.Placeholder.getPlaceholders(Placeholder.java:344) at be.maximvdw.animatednamescore.placeholders.Placeholder.getPlaceholderResult(Placeholder.java:148) at be.maximvdw.animatednamescore.hooks.MVdWPlaceholderAPIHook$MVdWPlaceholderHook.replacePlaceholders(MVdWPlaceholderAPIHook.java:99) at be.maximvdw.placeholderapi.PlaceholderAPI.replacePlaceholders(PlaceholderAPI.java:87) at com.extendedclip.papi.expansion.mvdw.MVdWExpansion.onPlaceholderRequest(MVdWExpansion.java:50) at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:342) at me.jacobculley.customgui.CustomGUI.placeholderMessage(CustomGUI.java:235) at me.jacobculley.customgui.Item.ReturnItem(Item.java:158) at me.jacobculley.customgui.GUI$1.run(GUI.java:225) at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftTask.run(CraftTask.java:58) at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:52) at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:748)

Any solution ? Thanks a lot

Fuizziy commented 7 years ago

I use the lastest version of ASkyBlock and PlaceholderAPI =)

Poslovitch commented 7 years ago

The placeholder is unofficial, but this NPE reflects a potential problem in our API, or on your server. Do you know for which player this error happens?

Fuizziy commented 7 years ago

All of them As you can see here, the first placeholders work very well http://prntscr.com/fw1cvh, but nothing appears after "Niveau d'île" (which means SkyBlock level)...

Fuizziy commented 7 years ago

I have tried clearing the ASkyBlock files, downgrading to versions whose links aren't even working on spigot. Also tried downgrading placeholdersAPI. But the only placeholders which don't work are still the AskyBlock ones. I am under 1.11

This message appears a lot while the server is loading No NMS Handler found for v1_11_R1, falling back to Bukkit API.

Poslovitch commented 7 years ago

According to clip, APi reference and player are not null

Fuizziy commented 7 years ago

What does that exactly means in my case ?

Poslovitch commented 7 years ago

This means there is a problem in the plugin that we need to investigate.

Fuizziy commented 7 years ago

Ok thanks a lot =) Do you think that you and Tastybento will be efficient enough to patch it today ? =D

Poslovitch commented 7 years ago

We may patch it today, however we probably won't release a new version with just a single fix that may not concern a lot of servers.

Fuizziy commented 7 years ago

Would you please be kind and upload a patch for me ? I'm working a lot with your API since a lot of my customers are using ASkyBlock... Just a link in private would be great. I would be very thankfull

tastybento commented 7 years ago

@Fuizziy From your error report:

[16:31:30 ERROR]: [AnimatedNames] Error in placeholder: {askyblock_team_leader_name} [16:31:30 ERROR]: [AnimatedNames] java.lang.NullPointerException at com.wasteofplastic.askyblock.ASkyBlockAPI.getTeamLeader(ASkyBlockAPI.java:153)

So, there is a null pointer exception. Let's look at ASkyBlockAPI.java, line 153:

    /**
     * Get Team Leader
     * 
     * @param playerUUID
     * @return UUID of Team Leader or null if there is none. Use inTeam to
     *         check.
     */
    public UUID getTeamLeader(UUID playerUUID) {
        return plugin.getPlayers().getTeamLeader(playerUUID);
    }

This can only be caused by "getPlayers()" being null. That means that the ASkyBlock plugin is not running correctly on your server because being able to get the players object is fundamental to the operation of the plugin.

So, the real problem is that ASkyBlock is not running correctly. Have you followed the correct install instructions and can make an island, etc? During server start, do you see any errors in your console log?

Fuizziy commented 7 years ago

All in-game functionnalities work perfectly, as you can see, there is no error in the log

[04:14:25] [Server thread/INFO]: [PowerfulPerms] Found Vault. Enabling Vault integration. [04:14:25] [Server thread/INFO]: [ASkyBlock] Enabling ASkyBlock v3.0.6.9 [04:14:26] [Server thread/INFO]: [ASkyBlock] HOPPER will be limited to 30 [04:14:26] [Server thread/INFO]: [ASkyBlock] No blockvalues.yml found. Creating it... [04:14:26] [Server thread/INFO]: [ASkyBlock] Using default found in jar file. [04:14:26] [Server thread/INFO]: [ASkyBlock] No resettimers.yml found. Creating it... [04:14:26] [Server thread/INFO]: [ASkyBlock] Default schematic does not exist, saving it... [04:14:26] [Server thread/INFO]: [ASkyBlock] Loaded default nether schematic [04:14:27] [Server thread/INFO]: [ASkyBlock] Loaded default nether schematic. [04:14:27] [Server thread/INFO]: [ASkyBlock] Loading schematic The Original (island.schematic) for all players, order 1 [04:14:27] [Server thread/INFO]: [ASkyBlock] Loading schematic NetherBlock Island (nether.schematic) for all players, order 0 [04:14:27] [Server thread/INFO]: [ASkyBlock] Loading schematic Island Duo (double.schematic) for all players, order 2 [04:14:27] [Server thread/INFO]: [ASkyBlock] Loading schematic §lBlack §bDiamonds (harder.schematic) for all players, order 3 [04:14:27] [Server thread/INFO]: [ASkyBlock] Loading offline messages...

No error with other plugins. I can create an island, access challenges. I'm running TorchSpigot, but I tried with Spigot / Paper and it didn't work aswell. I can drop you a complete log if you want:

https://pastebin.com/gdc3Xd7X

tastybento commented 7 years ago

Please try this build. Start the server, induce the error and share the log please.

askyblock.jar.zip

Fuizziy commented 7 years ago

Here it is chief https://pastebin.com/HN3xjepj

Fuizziy commented 7 years ago

Ok I have found something interesting. When disabling my plugin that hooks into your API, it seems to work. But I wonder why this plugin causes ASkyBlock placeholders to crash. Here are the interesting parts of my code:

In my main: https://pastebin.com/wrgxVGxa In the PlaceholderAPI hook: https://pastebin.com/khAZiX6w

I'm pretty sure it's because of the getInstance() method, but I don't know how to obtain the island object from an UUID without it. I don't want to use the getIslandOwnerBy method as it strictly requires the owner as argument to specify.

Fuizziy commented 7 years ago

Wait ? WAIT ? Did I call for the instance before it could have been initialized ?! What did I do ?! I'm so sorry for having wasted your time...

tastybento commented 7 years ago

@Fuizziy Can you show me more of the console log - right from the start? I want to see the words "DEBUG: Setting up player cache" which occurs in the onEnable part.

tastybento commented 7 years ago

I assume this is fixed...