Skip to content

Commit

Permalink
remove historical placeholders for fail/finish commands
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jun 26, 2019
1 parent 55a95c1 commit ea21b31
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 124 deletions.
24 changes: 0 additions & 24 deletions plugin/src/main/java/net/aufdemrand/denizen/objects/dPlayer.java
Expand Up @@ -6,8 +6,6 @@
import net.aufdemrand.denizen.nms.abstracts.Sidebar;
import net.aufdemrand.denizen.nms.interfaces.PlayerHelper;
import net.aufdemrand.denizen.objects.properties.entity.EntityHealth;
import net.aufdemrand.denizen.scripts.commands.core.FailCommand;
import net.aufdemrand.denizen.scripts.commands.core.FinishCommand;
import net.aufdemrand.denizen.scripts.commands.player.SidebarCommand;
import net.aufdemrand.denizen.tags.core.PlayerTags;
import net.aufdemrand.denizen.utilities.DenizenAPI;
Expand Down Expand Up @@ -1903,28 +1901,6 @@ else if (attribute.startsWith("percent")) {
return new Element(getName()).getAttribute(attribute.fulfill(1));
}

// <--[tag]
// @attribute <p@player.has_finished[<script>]>
// @returns Element(Boolean)
// @description
// Returns whether the player has finished the specified script. DEPRECATED: Use flags instead!
// -->
if (attribute.startsWith("has_finished")) {
FinishCommand.class.toString(); // TODO: Remove references to FINISH command.
dB.echoError("The 'FINISH' command is deprecated. Use flags instead!");
}

// <--[tag]
// @attribute <p@player.has_failed[<script>]>
// @returns Element(Boolean)
// @description
// Returns whether the player has failed the specified script. DEPRECATED: Use flags instead!
// -->
if (attribute.startsWith("has_failed")) {
FailCommand.class.toString(); // TODO: Remove references to FAIL command.
dB.echoError("The 'FAIL' command is deprecated. Use flags instead!");
}

/////////////////////
// LOCATION ATTRIBUTES
/////////////////
Expand Down
Expand Up @@ -210,26 +210,6 @@ public void registerCoreMembers() {
"EXPLODE", "explode (power:<#.#>) (<location>) (fire) (breakblocks)", 0);


// <--[command]
// @Name Fail
// @Syntax fail (script:<name>)
// @Required 0
// @Deprecated This command is outdated, use flags instead!
// @Short Marks a script as having failed.
// @Group core
//
// @Description
// DEPRECATED, use flags instead!
//
// @Tags
// DEPRECATED, use flags instead!
//
// @Usage
// DEPRECATED, use flags instead!
// -->
registerCoreMember(FailCommand.class,
"FAIL", "fail (script:<name>)", 0);

// <--[command]
// @Name FakeItem
// @Syntax fakeitem [<item>|...] [slot:<slot>] (duration:<duration>) (players:<player>|...) (player_only)
Expand Down Expand Up @@ -287,26 +267,6 @@ public void registerCoreMembers() {
"FEED", "feed (amt:<#>) (target:<entity>)", 0);


// <--[command]
// @Name Finish
// @Syntax finish (script:<name>)
// @Required 0
// @Deprecated This command is outdated, use flags instead!
// @Short Marks a script as having been completed successfully.
// @Group core
//
// @Description
// DEPRECATED, use flags instead!
//
// @Tags
// DEPRECATED, use flags instead!
//
// @Usage
// DEPRECATED, use flags instead!
// -->
registerCoreMember(FinishCommand.class,
"FINISH", "finish (script:<name>)", 0);


// <--[command]
// @Name Firework
Expand Down

This file was deleted.

This file was deleted.

Expand Up @@ -11,22 +11,14 @@

public class ResetCommand extends AbstractCommand {

private enum Type {FINISH, FAIL, PLAYER_COOLDOWN, GLOBAL_COOLDOWN, SAVES}
private enum Type {PLAYER_COOLDOWN, GLOBAL_COOLDOWN, SAVES}

@Override
public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {

for (aH.Argument arg : aH.interpretArguments(scriptEntry.aHArgs)) {

if (arg.matches("finishes", "finished", "finish")
&& !scriptEntry.hasObject("type")) {
scriptEntry.addObject("type", Type.FINISH);
}
else if (arg.matches("fails", "failed", "fail")
&& !scriptEntry.hasObject("type")) {
scriptEntry.addObject("type", Type.FAIL);
}
else if (arg.matches("cooldown")
if (arg.matches("cooldown")
&& !scriptEntry.hasObject("type")) {
scriptEntry.addObject("type", Type.PLAYER_COOLDOWN);
}
Expand Down Expand Up @@ -99,16 +91,6 @@ public void execute(ScriptEntry scriptEntry) {
if (resettable.isValid()) {

switch (type) {
case FAIL:
FailCommand.class.toString(); // TODO: Remove references to FAIL command.
dB.echoError("The 'FAIL' command is deprecated. Use flags instead!");
return;

case FINISH:
FinishCommand.class.toString(); // TODO: Remove references to FINISH command.
dB.echoError("The 'FINISH' command is deprecated. Use flags instead!");
return;

case PLAYER_COOLDOWN:
CooldownCommand.setCooldown(resettable, Duration.ZERO, script.getName(), false);
return;
Expand Down

0 comments on commit ea21b31

Please sign in to comment.