From 9a541bb36887820def7f1bffa491b8676163e96b Mon Sep 17 00:00:00 2001 From: aabssmc Date: Mon, 30 Oct 2023 20:19:45 -0700 Subject: [PATCH] fix --- .../elements/conditions/CondMainHand.java | 65 +++++++++---------- 1 file changed, 30 insertions(+), 35 deletions(-) diff --git a/src/main/java/lol/aabss/skuishy/elements/conditions/CondMainHand.java b/src/main/java/lol/aabss/skuishy/elements/conditions/CondMainHand.java index 4b4742f9..f9b864ab 100644 --- a/src/main/java/lol/aabss/skuishy/elements/conditions/CondMainHand.java +++ b/src/main/java/lol/aabss/skuishy/elements/conditions/CondMainHand.java @@ -14,48 +14,43 @@ import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; -import java.util.Objects; - @Name("Player - Main Hand") - @Description("Checks the player's main hand.") - @Examples({ - "on join:", - "\tif player's main hand is left:", - "\t\tsend \"you are not normal\" to player" - }) - @Since("1.2") - public class CondMainHand extends Condition { - - enum MainHandSide { - LEFT, RIGHT, UNKNOWN; - } - +@Name("Player - Main Hand") +@Description("Checks the player's main hand.") +@Examples({ + "on join:", + "\tif player's main hand is left:", + "\t\tsend \"you are not normal\" to player" +}) +@Since("1.2") +public class CondMainHand extends Condition { + enum MainHandSide { + LEFT, RIGHT, UNKNOWN; + } - static { - Skript.registerCondition(CondMainHand.class, - "%players%'s main hand (0:is|1:is( not|'nt)) (:left|:right)", - "main hand of %players% (0:is|1:is( not|'nt)) (:left|:right)" - ); - } - Expression player; + static { + Skript.registerCondition(CondMainHand.class, + "%players%'s main hand (0:is|1:is( not|n't)) (:left|:right)", + "main hand of %players% (0:is|1:is( not|n't)) (:left|:right)" + ); + } - int matpat; + Expression player; - MainHandSide side; + MainHandSide side; - @SuppressWarnings("unchecked") - @Override - public boolean init(Expression[] expressions, int matchedPattern, @NotNull Kleenean isDelayed, SkriptParser.ParseResult parser) { - this.player = (Expression) expressions[0]; - matpat = matchedPattern; - boolean negated = parser.mark == 1; - if (parser.hasTag("right")) side = MainHandSide.RIGHT; - else if (parser.hasTag("left")) side = MainHandSide.LEFT; - setNegated(negated); - return true; - } + @SuppressWarnings("unchecked") + @Override + public boolean init(Expression[] expressions, int matchedPattern, @NotNull Kleenean isDelayed, SkriptParser.ParseResult parser) { + this.player = (Expression) expressions[0]; + boolean negated = parser.mark == 1; + if (parser.hasTag("right")) side = MainHandSide.RIGHT; + else if (parser.hasTag("left")) side = MainHandSide.LEFT; + setNegated(negated); + return true; + } @Override public @NotNull String toString(@Nullable Event event, boolean debug) {