Skip to content

Conversation

@Banbeucmas
Copy link
Contributor

Pretty sure I want this to be an enhancement in 2.16.0
Still WIP tho.

Just that the placeholder seem to work flawlessly with PlaceholderAPI 2.8.5 tested

image

image

I hope my pr didn't fucked up lol. Haven't try to merge specific branch yet

@Banbeucmas
Copy link
Contributor Author

Yep it fucked up

@Banbeucmas
Copy link
Contributor Author

A little note:
image

@Banbeucmas
Copy link
Contributor Author

As for registering our own placeholder, https://github.com/PlaceholderAPI/Essentials-Expansion is already here, I think it is better to just continue to contribute there rather than putting them internally onto Essentials

@mdcfe mdcfe added the type: enhancement Features and feature requests. label Apr 2, 2018
@Banbeucmas
Copy link
Contributor Author

https://ibb.co/hn78wc

mdcfe added 5 commits April 3, 2018 11:23
Not sure if this is necessary - thoughts?
This will need to be manually changed everywhere `tl` is used where placeholders may be expected.
@Banbeucmas
Copy link
Contributor Author

Nice one.

Copy link
Contributor Author

@Banbeucmas Banbeucmas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plugin.yml might need some work

website: http://tiny.cc/EssentialsCommands
description: Provides an essential, core set of commands for Bukkit.
softdepend: [Vault]
softdepend: [Vault, PlaceholderAPI]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1945
You once said you don't want to add it as sofedepend.
Will we remove this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, forgot about that. Still need to implement handling of PAPI loading after EssentialsX though before we do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will leave that part to you then :)

Copy link
Contributor Author

@Banbeucmas Banbeucmas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was aware of this tho

return null;
}

input = input.replaceAll("\\{|\\}", "%");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There might be some problem that a single { standing alone will become % after that. I don't use regex for a long time. Should we do something about it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/{([A-Za-z0-9_]+)}/g might work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@md678685 I love IntelliJ
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need to address this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the replacement with that regex would have been "%$1%", since the ()s in the regex capture the placeholder name (bobsplugin_hunger) and the $1 puts it back in the string once replaced.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love how the problem still excist tho. Idk why but seem like Java Regex behaves different than JS


input = input.replaceAll("\\{|\\}", "%");

if (papiEnabled == null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still needs to be here, in case PAPI loads before EssentialsX - in that instance, Essentials won't receive PAPI's PluginEnableEvent.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is also the reason for the null - at the point that the class is loaded, we won't know whether PAPI is enabled, and it also might not be a safe time to check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that make sense. Let me change that

//The warp function is a wrapper used to teleportPlayer a player to a /warp
@Override
public void warp(IUser teleportee, String warp, Trade chargeFor, TeleportCause cause) throws Exception {
UserWarpEvent event = new UserWarpEvent(teleportee, warp, chargeFor);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be in its own PR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this change is in this PR but the actual PR is here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I accidentally create the Papi branch out of the original branch of my fork and PR before even realize it.
We will just solve both PR at the same time or if anyone have a better idea.

@mdcfe mdcfe mentioned this pull request Jun 14, 2018
6 tasks
@Banbeucmas
Copy link
Contributor Author

Should we close this in favor of #2041?

@mdcfe
Copy link
Member

mdcfe commented Aug 19, 2018

@Banbeucmas Yes, closing this PR now.

@mdcfe mdcfe closed this Aug 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement Features and feature requests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants