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

Adds the "remove_essentials_home" mechanism #405

Merged
merged 4 commits into from
Apr 24, 2023
Merged

Adds the "remove_essentials_home" mechanism #405

merged 4 commits into from
Apr 24, 2023

Conversation

heypr
Copy link
Contributor

@heypr heypr commented Apr 17, 2023

Adds the "remove_essentials_home" mechanism.

Adds the "remove_essentials_home" mechanism.
// <--[mechanism]
// @object PlayerTag
// @name remove_essentials_home
// @input ElementTag(String)
Copy link
Member

Choose a reason for hiding this comment

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

(String) isn't a thing

// @input ElementTag(String)
// @plugin Depenizen, Essentials
// @description
// Removes the specified player's Essentials home.
Copy link
Member

Choose a reason for hiding this comment

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

the player's Essentials home that matches the specified name
"the specified (x)" generally corresponds to the input parameter rather than the base object

if (mechanism.matches("remove_essentials_home")) {
try {
getUser().delHome(mechanism.getValue().toString());
} catch (Exception e) {
Copy link
Member

Choose a reason for hiding this comment

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

newline after }

@@ -50,7 +50,7 @@ public static EssentialsPlayerProperties getFrom(ObjectTag object) {
};

public static final String[] handledMechs = new String[] {
"is_afk", "god_mode", "is_muted", "socialspy", "vanish", "essentials_ignore"
"is_afk", "god_mode", "is_muted", "socialspy", "vanish", "essentials_ignore", "remove_essentials_home"
Copy link
Member

Choose a reason for hiding this comment

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

This is very old legacy code, you don't have to fix it in this PR but it'd be helpful to update to modern format per DenizenScript/Denizen#2355

getUser().delHome(mechanism.getValue().toString());
}
catch (Exception e) {
Debug.echoError("Invalid home name specified!");
Copy link
Member

Choose a reason for hiding this comment

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

Prior comment still applies here.

getUser().delHome(mechanism.getValue().toString());
}
catch (Exception e) {
mechanism.echoError("Invalid home name specified!");
Copy link
Member

Choose a reason for hiding this comment

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

Prior comment continues to apply here.

@mcmonkey4eva mcmonkey4eva merged commit 5db2ae1 into DenizenScript:master Apr 24, 2023
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

Successfully merging this pull request may close these issues.

2 participants