Skip to content

Commit

Permalink
minor event cleanings
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Aug 18, 2020
1 parent 9136231 commit 8ec21ad
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 17 deletions.
Expand Up @@ -7,7 +7,6 @@
import com.denizenscript.denizencore.objects.core.ElementTag;
import com.denizenscript.denizencore.objects.ObjectTag;
import com.denizenscript.denizencore.scripts.ScriptEntryData;
import com.denizenscript.denizencore.utilities.CoreUtilities;
import org.bukkit.entity.Entity;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
Expand Down Expand Up @@ -68,20 +67,16 @@ public boolean couldMatch(ScriptPath path) {

@Override
public boolean matches(ScriptPath path) {

if (!tryEntity(entity, path.eventArgLowerAt(0))) {
return false;
}

if (path.eventArgLowerAt(2).equals("because")
&& !CoreUtilities.equalsIgnoreCase(path.eventArgLowerAt(3), reason.toString())) {
&& !runGenericCheck(path.eventArgLowerAt(3), reason.toString())) {
return false;
}

if (!runInCheck(path, location)) {
return false;
}

return super.matches(path);
}

Expand Down Expand Up @@ -120,5 +115,4 @@ public void onCreatureSpawn(CreatureSpawnEvent event) {
fire(event);
EntityTag.forgetEntity(entity);
}

}
Expand Up @@ -48,9 +48,6 @@ public boolean couldMatch(ScriptPath path) {
if (!path.eventLower.startsWith("experience bottle breaks")) {
return false;
}
if (!couldMatchEntity(path.eventArgLowerAt(0))) {
return false;
}
return true;
}

Expand Down
Expand Up @@ -60,10 +60,9 @@ public boolean matches(ScriptPath path) {
return false;
}
String ani = path.eventArgLowerAt(2);
if (ani.length() > 0 && !ani.equals("in") && !ani.equalsIgnoreCase(animation)) {
if (ani.length() > 0 && !ani.equals("in") && !runGenericCheck(ani, animation)) {
return false;
}

return super.matches(path);
}

Expand Down
Expand Up @@ -7,7 +7,6 @@
import com.denizenscript.denizencore.objects.core.ElementTag;
import com.denizenscript.denizencore.objects.ObjectTag;
import com.denizenscript.denizencore.scripts.ScriptEntryData;
import com.denizenscript.denizencore.utilities.CoreUtilities;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerGameModeChangeEvent;
Expand Down Expand Up @@ -53,7 +52,7 @@ public boolean couldMatch(ScriptPath path) {
public boolean matches(ScriptPath path) {
String mode = path.eventArgLowerAt(4);
if (mode.length() > 0) {
if (!CoreUtilities.equalsIgnoreCase(gamemode.asString(), mode)) {
if (!runGenericCheck(mode, gamemode.asString())) {
return false;
}
}
Expand Down
Expand Up @@ -7,7 +7,6 @@
import com.denizenscript.denizencore.objects.core.ElementTag;
import com.denizenscript.denizencore.objects.ObjectTag;
import com.denizenscript.denizencore.scripts.ScriptEntryData;
import com.denizenscript.denizencore.utilities.CoreUtilities;
import org.bukkit.Material;
import org.bukkit.event.Event;
import org.bukkit.event.EventHandler;
Expand Down Expand Up @@ -81,7 +80,7 @@ private boolean runUsingCheck(ScriptPath path) {
Debug.echoError("Invalid USING hand in " + getName() + " for '" + path.event + "' in " + path.container.getName());
return false;
}
if (!using.equals("either_hand") && !CoreUtilities.equalsIgnoreCase(using, hand.identify())) {
if (!using.equals("either_hand") && !runGenericCheck(using, hand.identify())) {
return false;
}
return true;
Expand Down
Expand Up @@ -60,7 +60,7 @@ public TeleportCommand() {
// - teleport <server.online_players> <player.location>
//
// @Usage
// Use to teleport the NPC to a location that was noted wih the <@link commmand note> command.
// Use to teleport the NPC to a location that was noted wih the <@link command note> command.
// - teleport <npc> my_prenoted_location
// -->

Expand Down

0 comments on commit 8ec21ad

Please sign in to comment.