Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix 2 switches to support list input
  • Loading branch information
mcmonkey4eva committed Oct 5, 2017
1 parent e86b77b commit 84e2f73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
Expand Up @@ -5,6 +5,7 @@
import com.denizenscript.denizen2core.tags.objects.ListTag;
import com.denizenscript.denizen2core.tags.objects.TextTag;
import com.denizenscript.denizen2sponge.Denizen2Sponge;
import com.denizenscript.denizen2sponge.events.D2SpongeEventHelper;
import com.denizenscript.denizen2sponge.tags.objects.EntityTag;
import com.denizenscript.denizen2sponge.tags.objects.LocationTag;
import com.denizenscript.denizen2sponge.tags.objects.PlayerTag;
Expand Down Expand Up @@ -63,12 +64,7 @@ public boolean couldMatch(ScriptEventData data) {

@Override
public boolean matches(ScriptEventData data) {
if (data.switches.containsKey("command")) {
if (!data.switches.get("command").equalsIgnoreCase(command.getInternal())) {
return false;
}
}
return true;
return D2SpongeEventHelper.checkString(command.getInternal(), data, this::error, "command");
}

public TextTag command;
Expand Down
Expand Up @@ -5,6 +5,7 @@
import com.denizenscript.denizen2core.tags.objects.MapTag;
import com.denizenscript.denizen2core.tags.objects.TextTag;
import com.denizenscript.denizen2sponge.Denizen2Sponge;
import com.denizenscript.denizen2sponge.events.D2SpongeEventHelper;
import org.spongepowered.api.Sponge;
import org.spongepowered.api.event.Cancellable;
import org.spongepowered.api.event.Event;
Expand Down Expand Up @@ -52,12 +53,7 @@ public boolean couldMatch(ScriptEventData data) {

@Override
public boolean matches(ScriptEventData data) {
if (data.switches.containsKey("event_type")) {
if (!data.switches.get("event_type").equalsIgnoreCase(event_type.getInternal())) {
return false;
}
}
return true;
return D2SpongeEventHelper.checkString(event_type.getInternal(), data, this::error, "event_type");
}

public TextTag event_type;
Expand Down

0 comments on commit 84e2f73

Please sign in to comment.