Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some armour stand syntax #6613

Open
wants to merge 18 commits into
base: dev/feature
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -25,7 +25,7 @@
import ch.njol.skript.doc.Since;
import ch.njol.skript.lang.Condition;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser;
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.util.Kleenean;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.LivingEntity;
Expand Down Expand Up @@ -55,7 +55,7 @@ public class CondArmorStandBehaviour extends Condition {

@SuppressWarnings("unchecked")
@Override
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed, SkriptParser.ParseResult parseResult) {
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) {
entities = (Expression<LivingEntity>) exprs[0];
tick = parseResult.hasTag("tick");
setNegated(matchedPattern == 1);
Expand Down
Expand Up @@ -26,7 +26,7 @@
import ch.njol.skript.doc.Since;
import ch.njol.skript.lang.Condition;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser;
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.util.Kleenean;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.LivingEntity;
Expand Down Expand Up @@ -56,7 +56,7 @@ public class CondArmorStandExtremities extends Condition {

@SuppressWarnings("unchecked")
@Override
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed, SkriptParser.ParseResult parseResult) {
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) {
entities = (Expression<LivingEntity>) exprs[0];
arms = parseResult.hasTag("arms");
setNegated(matchedPattern == 1);
Expand Down
Expand Up @@ -25,7 +25,7 @@
import ch.njol.skript.doc.Since;
import ch.njol.skript.lang.Condition;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser;
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.util.Kleenean;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.LivingEntity;
Expand Down Expand Up @@ -54,7 +54,7 @@ public class CondArmorStandProperties extends Condition {

@SuppressWarnings("unchecked")
@Override
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed, SkriptParser.ParseResult parseResult) {
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) {
entities = (Expression<LivingEntity>) exprs[0];
small = parseResult.hasTag("small");
setNegated(matchedPattern == 1);
Expand Down
@@ -0,0 +1,19 @@
test "armour stand behaviour":
parse if method "org.bukkit.entity.ArmorStand##canTick()" exists:
spawn an armor stand at (spawn of world "world")
set {_e} to last spawned armor stand

assert {_e} is able to tick with "a normally spawned armour stand should be able to tick"
assert {_e} is able to move with "a normally spawned armour stand should be able to move"

prevent {_e} from being able to tick
prevent {_e} from being able to move
assert {_e} isn't able to tick with "preventing an armour stand from being able to tick should do exactly that"
assert {_e} isn't able to move with "preventing an armour stand from being able to move should do exactly that"

allow {_e} to tick
allow {_e} to move
assert {_e} is able to tick with "allowing an armour stand to tick should do exactly that"
assert {_e} is able to move with "allowing an armour stand to move should do exactly that"

delete last spawned armor stand
cheeezburga marked this conversation as resolved.
Show resolved Hide resolved
@@ -0,0 +1,18 @@
test "armour stand extremities":
spawn an armor stand at (spawn of world "world")
set {_e} to last spawned armor stand

assert {_e} doesn't have arms with "a normally spawned armour stand shouldn't have arms"
assert {_e} has a base plate with "a normally spawned armour stand should have a base plate"

show {_e}'s arms
hide {_e}'s base plate
assert {_e} has arms with "showing the arms of an armour stand should do exactly that"
assert {_e} doesn't have a base plate with "hiding the base plate of an armour stand should do exactly that"

hide {_e}'s arms
show {_e}'s base plate
assert {_e} doesn't have arms with "hiding the arms of an armour stand should do exactly that"
assert {_e} is able to move with "showing the base plate of an armour stand should do exactly that"

delete last spawned armor stand
cheeezburga marked this conversation as resolved.
Show resolved Hide resolved
@@ -0,0 +1,18 @@
test "armour stand properties":
spawn an armor stand at (spawn of world "world")
set {_e} to last spawned armor stand

assert {_e} isn't small with "a normally spawned armour stand should not be small"
assert {_e} isn't a marker with "a normally spawned armour stand should not be a marker"

make {_e} small
make {_e} a marker
assert {_e} is small with "making an armour stand small should do exactly that"
assert {_e} is a marker with "making an armour stand a marker should do exactly that"

make {_e} not small
make {_e} not a marker
assert {_e} is not small with "making an armour stand not small should do exactly that"
assert {_e} is not a marker with "making an armour stand not a marker should do exactly that"

delete last spawned armor stand
cheeezburga marked this conversation as resolved.
Show resolved Hide resolved