-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Conversation
Adds the "remove_essentials_home" mechanism.
// <--[mechanism] | ||
// @object PlayerTag | ||
// @name remove_essentials_home | ||
// @input ElementTag(String) |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newline after }
...ava/com/denizenscript/depenizen/bukkit/properties/essentials/EssentialsPlayerProperties.java
Show resolved
Hide resolved
@@ -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" |
There was a problem hiding this comment.
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!"); |
There was a problem hiding this comment.
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!"); |
There was a problem hiding this comment.
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.
Adds the "remove_essentials_home" mechanism.