Skip to content

Commit

Permalink
feat(tsl): add IS comparator for strings
Browse files Browse the repository at this point in the history
  • Loading branch information
iGoodie committed Oct 26, 2019
1 parent a308e03 commit f3f9ffe
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Expand Up @@ -5,7 +5,7 @@ org.gradle.daemon=false

mod_id=twitchspawn
mod_group=net.programmer.igoodie
mod_version=0.4.6
mod_version=0.4.7

minecraft_version=1.12.2
forge_version=14.23.3.2655
Expand Down
Expand Up @@ -6,6 +6,8 @@ public enum TSLComparatorSymbol {

IN_RANGE(
"IN RANGE", InRangeComparator.class),
IS(
"IS", IsComparator.class),
PREFIX(
"PREFIX", PrefixComparator.class),
POSTFIX(
Expand Down
@@ -0,0 +1,17 @@
package net.programmer.igoodie.twitchspawn.tslanguage.predicate;

public class IsComparator extends TSLComparator {

protected String value;

public IsComparator(String rightHandRaw) {
this.value = rightHandRaw;
}

@Override
public boolean compare(Object leftHand) {
return leftHand instanceof String
&& value.equalsIgnoreCase((String) leftHand);
}

}

0 comments on commit f3f9ffe

Please sign in to comment.