Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Placeholder %statistic_mine_block% raise exception #5

Closed
Qveshn opened this issue Jan 5, 2019 · 4 comments
Closed

Placeholder %statistic_mine_block% raise exception #5

Qveshn opened this issue Jan 5, 2019 · 4 comments

Comments

@Qveshn
Copy link

Qveshn commented Jan 5, 2019

There is a bug with expansion statistic, placeholder %statistic_mine_block%

/papi parse myname %statistic_mine_block%

[23:04:07] [Server thread/WARN]: Unexpected exception while parsing console command "papi parse myname %statistic_mine_block%"
org.bukkit.command.CommandException: Unhandled exception executing command 'papi' in plugin PlaceholderAPI v2.9.2
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spigot-1.12.2-1573-i.jar:git-Spigot-e8ded36-acbc348]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[spigot-1.12.2-1573-i.jar:git-Spigot-e8ded36-acbc348]
    at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:648) ~[spigot-1.12.2-1573-i.jar:git-Spigot-e8ded36-acbc348]
    at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchServerCommand(CraftServer.java:634) [spigot-1.12.2-1573-i.jar:git-Spigot-e8ded36-acbc348]
    at net.minecraft.server.v1_12_R1.DedicatedServer.aP(DedicatedServer.java:444) [spigot-1.12.2-1573-i.jar:git-Spigot-e8ded36-acbc348]
    at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:407) [spigot-1.12.2-1573-i.jar:git-Spigot-e8ded36-acbc348]
    at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679) [spigot-1.12.2-1573-i.jar:git-Spigot-e8ded36-acbc348]
    at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577) [spigot-1.12.2-1573-i.jar:git-Spigot-e8ded36-acbc348]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
Caused by: java.lang.IllegalArgumentException: The supplied Material does not have a corresponding statistic
    at org.apache.commons.lang.Validate.notNull(Validate.java:192) ~[spigot-1.12.2-1573-i.jar:git-Spigot-e8ded36-acbc348]
    at org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer.getStatistic(CraftPlayer.java:662) ~[spigot-1.12.2-1573-i.jar:git-Spigot-e8ded36-acbc348]
    at com.extendedclip.papi.expansion.mcstatistics.StatisticsExpansion.onPlaceholderRequest(StatisticsExpansion.java:86) ~[?:?]
    at me.clip.placeholderapi.PlaceholderHook.onRequest(PlaceholderHook.java:38) ~[PlaceholderAPI-2.9.2.jar:?]
    at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:237) ~[PlaceholderAPI-2.9.2.jar:?]
    at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:205) ~[PlaceholderAPI-2.9.2.jar:?]
    at me.clip.placeholderapi.commands.PlaceholderAPICommands.onCommand(PlaceholderAPICommands.java:186) ~[PlaceholderAPI-2.9.2.jar:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot-1.12.2-1573-i.jar:git-Spigot-e8ded36-acbc348]
    ... 8 more

Looks like not all "block" materials have statistic 😉

Info:

/version
This server is running CraftBukkit version git-Spigot-e8ded36-acbc348 (MC: 1.12.2) (Implementing API version 1.12.2-R0.1-SNAPSHOT)
This is a final build for 1.12.2. Please see https://www.spigotmc.org/ for details about upgrading.

/papi
PlaceholderAPI version 2.9.2
Created by: extended_clip

/papi info statistic
Placeholder expansion info for: statistic
Status: Registered
Created by: clip
Version: 1.9.2

/papi ecloud info statistic
Statistic -- http://api.extendedclip.com/media/PAPI-Expansion-Statistic_BcbA2ZL.jar

/papi ecloud versioninfo statistic 1.9.2
Expansion: Statistic
Version: 1.9.2
Version info: Fixed issues with 1.12
Download url: http://api.extendedclip.com/media/PAPI-Expansion-Statistic_BcbA2ZL.jar
@Andre601
Copy link

Andre601 commented Jan 6, 2019

I'm no expert in that, but afaik do you have to provide a block through the statistic-placeholder.
For example: %statistic_mine_block:STONE%

@Qveshn
Copy link
Author

Qveshn commented Jan 6, 2019

%statistic_mine_block:STONE% works fine, but I need %statistic_mine_block% to show total count of blocks for user

@Qveshn
Copy link
Author

Qveshn commented Jan 6, 2019

I have made pull request #6
Look it please.
You can also consider to remove "bad" materials from mine_block collection in case of an exception.
😃

@aBooDyy
Copy link

aBooDyy commented Jul 17, 2019

Statistic v1.9.2 doesn't work in MC 1.12.2 or older, you'll have to use v1.7.0

/papi ecloud download Statistic 1.7.0
/papi reload

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants