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

Added is_trusted placeholders #6240

Merged
merged 3 commits into from
Oct 16, 2022

Conversation

PainOchoco
Copy link
Contributor

@PainOchoco PainOchoco commented Oct 16, 2022

Description:

  • Added PAPI placeholders:
    • %townyadvanced_player_town_is_trusted% - returns True or False based on whether the player is in a town, and is trusted in the town.
    • %townyadvanced_player_plot_is_trusted% - returns True or False based on whether the player is in a town, and is trusted in the plot.

New Nodes/Commands/ConfigOptions:


Relevant Towny Issue ticket:

Closes #6230


  • I have tested this pull request for defects on a server.

By making this pull request, I represent that I have the right to waive copyright and related rights to my contribution, and agree that all copyright and related rights in my contributions are waived, and I acknowledge that the TownyAdvanced organization has the copyright to use and modify my contribution under the Towny License for perpetuity.

Copy link
Member

@LlmDl LlmDl left a comment

Choose a reason for hiding this comment

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

This actually has to be done lower in the getPlayerPlaceholder(Player player, String identifier) and use the Town from the townBlock like so:

return townblock != null ? String.valueOf(townblock.getTownOrNull().hasTrustedResident(resident)) : "";

because a resident doesn't have to be a member of the town to become trusted there.

Copy link
Member

@LlmDl LlmDl left a comment

Choose a reason for hiding this comment

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

I think the only other thing that is needed is either the placeholder name should be is_town_trusted, since it's not tested against whether they're plot-trusted.

You could also add a is_plot_trusted placeholder as well.

@PainOchoco
Copy link
Contributor Author

Alright

@PainOchoco
Copy link
Contributor Author

Should the default value be "" or "false"?

@LlmDl
Copy link
Member

LlmDl commented Oct 16, 2022

The "" is only going to appear in the wilderness, it might make sense to just leave it blank.

@PainOchoco PainOchoco requested a review from LlmDl October 16, 2022 15:00
@PainOchoco
Copy link
Contributor Author

Please don't forget to add the hacktoberfest label :D

@LlmDl LlmDl added this to the 0.98.4.0 milestone Oct 16, 2022
@LlmDl LlmDl added the Label-Placeholders Tickets related to the PlaceholderAPI. label Oct 16, 2022
@LlmDl LlmDl merged commit bcfc963 into TownyAdvanced:master Oct 16, 2022
@LlmDl LlmDl changed the title Added %townyadvanced_is_trusted% placeholder Added is_trusted placeholders Oct 16, 2022
LlmDl added a commit that referenced this pull request Oct 16, 2022
closing #6230.
    - %townyadvanced_player_town_is_trusted% - returns True or False
based on whether the player is in a town, and is trusted in the town.
    - %townyadvanced_player_plot_is_trusted% - returns True or False
based on whether the player is in a town, and is trusted in the plot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Label-Placeholders Tickets related to the PlaceholderAPI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggestion: Add placeholder which will return trust player in town (true or false)
2 participants