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

PlaceholderAPI Placeholders automatically registered to each GameModeAddon #322

Closed
BiGUNMAN opened this issue Oct 31, 2018 · 29 comments
Closed
Assignees
Labels
Status: Done This issue has been completed or answered. This pull request has been merged. Type: Enhancement Improvement or modification which is usually a new feature.
Projects
Milestone

Comments

@BiGUNMAN
Copy link

BiGUNMAN commented Oct 31, 2018

Description
Placeholders that hook into PlaceholderAPI.

Placeholders
%island_owner% - Owner of current island, returns empty if no owner.
%island_team_size% - Returns number of island members
%island_team_member_[#] - Returns name of island member (# represents a particular member)
%island_level_top_value_[1-10] - Displays the level of the top islands (1 being #1 island, 10 being #10 island)
%island_level_top_name_[1-10] - Displays island owner of the top islands
%island_protection_size% - Returns protection size of the player's island (not the island they are standing in, but their own island).
%island_flag_(flag-name)% - Return the value that the island flag is set to - this will probably be used the least.
%island_has_island% - true/false if player has an island - Should probably include a 3rd option that says if they are part of a team.

I've probably not thought of everything yet, but this is a start. I think the ones above will be used the most.

More Placeholders
PlaceholderAPI: https://www.spigotmc.org/wiki/placeholderapi-plugin-placeholders-page-1/#askyblock - has 4 more nice placeholders that would also probably be nice to have (island z, x, world, coop).

MVDW has a ton of placeholders, not sure how necessary they are. The more the merrier though: https://www.spigotmc.org/wiki/mvdw-placeholders/

@Poslovitch Poslovitch added the Type: Enhancement Improvement or modification which is usually a new feature. label Oct 31, 2018
@Poslovitch Poslovitch changed the title PlaceholderAPI Placeholders Placeholders Nov 1, 2018
@Poslovitch Poslovitch added this to To do in Alphas Nov 1, 2018
@Poslovitch
Copy link
Member

@Poslovitch Poslovitch self-assigned this Nov 1, 2018
@Poslovitch Poslovitch moved this from To do to In progress in Alphas Nov 2, 2018
@Poslovitch Poslovitch changed the title Placeholders PlaceholderAPI Placeholders Nov 2, 2018
@Poslovitch
Copy link
Member

Poslovitch commented Nov 2, 2018

PlaceholderAPI integration is done. Let's add the placeholders now!

@tastybento
Copy link
Member

There's a bug that occurs on startup with 0.13.0-SNAPSHOT because the plugin doesn't check if PlaceholderAPI plugin exists or not.

[01:31:27 WARN]: [BentoBox] Task #8 for BentoBox v0.13.0-SNAPSHOT generated an exception
java.lang.NoClassDefFoundError: me/clip/placeholderapi/expansion/PlaceholderExpansion
	at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.8.0_181]
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763) ~[?:1.8.0_181]
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[?:1.8.0_181]
	at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:150) ~[spigot.jar:git-Spigot-2474d93-e693496]
	at org.bukkit.plugin.java.JavaPluginLoader.getClassByName(JavaPluginLoader.java:193) ~[spigot.jar:git-Spigot-2474d93-e693496]
	at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:111) ~[spigot.jar:git-Spigot-2474d93-e693496]
	at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:100) ~[spigot.jar:git-Spigot-2474d93-e693496]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_181]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_181]
	at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.8.0_181]
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763) ~[?:1.8.0_181]
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[?:1.8.0_181]
	at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:150) ~[spigot.jar:git-Spigot-2474d93-e693496]
	at org.bukkit.plugin.java.JavaPluginLoader.getClassByName(JavaPluginLoader.java:193) ~[spigot.jar:git-Spigot-2474d93-e693496]
	at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:111) ~[spigot.jar:git-Spigot-2474d93-e693496]
	at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:100) ~[spigot.jar:git-Spigot-2474d93-e693496]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_181]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_181]
	at world.bentobox.bentobox.hooks.PlaceholderAPIHook.<init>(PlaceholderAPIHook.java:27) ~[?:?]
	at world.bentobox.bentobox.BentoBox.lambda$onEnable$1(BentoBox.java:150) ~[?:?]
	at org.bukkit.craftbukkit.v1_13_R2.scheduler.CraftTask.run(CraftTask.java:76) ~[spigot.jar:git-Spigot-2474d93-e693496]
	at org.bukkit.craftbukkit.v1_13_R2.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:361) [spigot.jar:git-Spigot-2474d93-e693496]
	at net.minecraft.server.v1_13_R2.MinecraftServer.b(MinecraftServer.java:893) [spigot.jar:git-Spigot-2474d93-e693496]
	at net.minecraft.server.v1_13_R2.DedicatedServer.b(DedicatedServer.java:417) [spigot.jar:git-Spigot-2474d93-e693496]
	at net.minecraft.server.v1_13_R2.MinecraftServer.a(MinecraftServer.java:835) [spigot.jar:git-Spigot-2474d93-e693496]
	at net.minecraft.server.v1_13_R2.MinecraftServer.run(MinecraftServer.java:733) [spigot.jar:git-Spigot-2474d93-e693496]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
Caused by: java.lang.ClassNotFoundException: me.clip.placeholderapi.expansion.PlaceholderExpansion
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[?:1.8.0_181]
	at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:154) ~[spigot.jar:git-Spigot-2474d93-e693496]
	at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:100) ~[spigot.jar:git-Spigot-2474d93-e693496]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_181]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_181]
	... 27 more

I'll try and fix it.

@tastybento
Copy link
Member

@Poslovitch I added a check for the Placeholder API's mentioned in the soft depend of plugin.yml. I am not familiar with MVdWPlaceholderAPI. I included it in the check but I don't think it's a drop-in replacement so I think the check should just be for PlaceholderAPI right now. Can you check it?

@Poslovitch
Copy link
Member

Oh, I see what's wrong on this one!

@Poslovitch
Copy link
Member

Poslovitch commented Nov 4, 2018

MVdWPlaceholderAPI is not supported yet though. Maybe I'll work on this today.

@Poslovitch
Copy link
Member

Fixed the bug once and for all in the commit above

@Poslovitch
Copy link
Member

Poslovitch commented Nov 8, 2018

Here are some other placeholders I thought may be interesting:

%sb_island_protection_range%
%sb_island_center%
%sb_island_owner%
%sb_island_creation_date%
%sb_island_distance%
%sb_island_spawnpoint%

@Kryniowesegryderiusz
Copy link

Where can i find list of actually implemented placeholders?

@Poslovitch
Copy link
Member

@Kryniowesegryderiusz None is implemented yet.

@TheWranger
Copy link

@Poslovitch PlaceholderAPI already has a placeholder that allows you to use any placeholder from MVdWPlaceholderAPI

@AbelMG
Copy link

AbelMG commented Dec 8, 2018

How can I add addons to BSkyblock?

@Poslovitch
Copy link
Member

@AbelMG Off-topic.

@BentoBoxWorld BentoBoxWorld locked as off-topic and limited conversation to collaborators Dec 8, 2018
@BentoBoxWorld BentoBoxWorld unlocked this conversation Dec 29, 2018
@tastybento
Copy link
Member

Added these placeholders (BSkyBlock examples):

Level Placeholder
%Level_bskyblock-island-level% - the player's level

Top Ten Placeholders
%Level_bskyblock-island-level-top-value-x% where x is a number between 1 and 10
%Level_bskyblock-island-level-top-name-x% where x is a number between 1 and 10

If the top ten is less than 10 players then the placeholder will return an empty string.

To get the the values for other game modes, for example AcidIsland or CaveBlock, use the same format but with the Addon name in lower case, e.g. %Level_acidisland-island-level%

@PizzaMC
Copy link

PizzaMC commented Feb 16, 2019

These don't work. No placeholders on mentioned here work..

@Poslovitch
Copy link
Member

@PizzaMC ...Maybe because this is a feature request...?

@Poslovitch
Copy link
Member

Anyway, I'm gonna work on placeholders that'll be automatically registered by every GameModeAddon. That's going to be easier.

@Poslovitch Poslovitch added this to the 1.3.0 milestone Feb 16, 2019
@Poslovitch Poslovitch changed the title PlaceholderAPI Placeholders PlaceholderAPI Placeholders automatically registered to each GameModeAddon Feb 16, 2019
@tastybento
Copy link
Member

@PizzaMC The Level add-on ones are done and work. It does require PAPI plugin to be installed. The BentoBox ones though still need to be done.

@Poslovitch Poslovitch added Status: Pending Waiting for a developer to start working on this issue. Priority: High labels Feb 19, 2019
@Poslovitch Poslovitch modified the milestones: 1.3.0, 1.4.0 Feb 19, 2019
@Poslovitch Poslovitch added Status: Accepted and removed Status: Pending Waiting for a developer to start working on this issue. labels Feb 20, 2019
@Deathinflames
Copy link

Deathinflames commented Feb 22, 2019

Hiya Poslovitch and tastybento! :D

May i request that the next placeholder to be implemented be one that returns true/false if the player is the island owner? It would be super beneficial to have this placeholder so that it could be used as an important requirement to check for island upgrades.

I know there are more important things to work on but i thought i'd just throw this out there due to how useful it actually is.

Thanks!

@BONNe
Copy link
Member

BONNe commented Feb 22, 2019

If you plan to use placeholders just to find out, if user has or has not owner of island, then you are doing something wrong.

I know, that "hype" about placeholders is their simplicity. But using them to get information is just the same, as using JAVA to open any browser. Yes, you can do it, but it is just wrong.

@Poslovitch
Copy link
Member

@Deathinflames @BONNe Placeholders are not designed to get data that will later be used in a programmatic manner. They're used to display things.

And @Deathinflames: such placeholder has already been suggested.

@BONNe
Copy link
Member

BONNe commented Feb 22, 2019

@Poslovitch
No there is not a placeholder, that returns TRUE/FALSE and @Deathinflames was asking for it.

@Poslovitch
Copy link
Member

@BONNe I think you misunderstood what I was saying:
image

Placeholders are not methods to get data like Island#getOwner() would. They are used to display things. true, false, 45, 798.13 €, Pikachu, N/A...

@Deathinflames
Copy link

Deathinflames commented Feb 22, 2019

@BONNe While i understand that placeholders might not be designed to be used in a programmatic manner as @Poslovitch has pointed out, and they should only be used to display stats and such, there are more than quite a few people that use them in conjunction with say DeluxeMenus for example as conditional requirements for other things that IMO do not justify the need to have a whole separate addon/plugin be created for if it can just be as simple as checking the output of certain placeholders.

Yes, i agree this might be wrong and not a very logical way of doing things from a developers point of view but for the sake of functionality it's another valid way of doing things and it works quite well, otherwise why would clip have created such a thing?

Also @Poslovitch i understand it's already been suggested, my post was simply to request that this particular placeholder be expedited, but i think that's probably out the window now with this disagreement in functionality.

@Poslovitch
Copy link
Member

Placeholders are planned and will be implemented in 1.4.0. Don't worry about that @Deathinflames.

@TheWranger
Copy link

TheWranger commented Feb 24, 2019

Would also be cool to see a placeholder that returns how many island resets the player has left.
%island_resets_remaining%

@Poslovitch Poslovitch added Status: Done This issue has been completed or answered. This pull request has been merged. and removed Status: Accepted labels Mar 24, 2019
@Poslovitch
Copy link
Member

Closing this, as the PR has been merged. Please create feature requests if you want us to add some specific placeholders that we didn't add there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Done This issue has been completed or answered. This pull request has been merged. Type: Enhancement Improvement or modification which is usually a new feature.
Projects
No open projects
Alphas
  
In progress
Development

No branches or pull requests

9 participants