From 88654854740a9122b6d8f230f09d04781ba1ab92 Mon Sep 17 00:00:00 2001 From: ShaneBeee Date: Tue, 8 Oct 2019 01:13:30 -0700 Subject: [PATCH 1/2] FoxData - fixes - Fixed an issue with "all foxes" not doing anything --- src/main/java/ch/njol/skript/entity/FoxData.java | 2 +- src/main/java/ch/njol/skript/entity/SimpleEntityData.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/ch/njol/skript/entity/FoxData.java b/src/main/java/ch/njol/skript/entity/FoxData.java index 14630642f70..92150caa1af 100644 --- a/src/main/java/ch/njol/skript/entity/FoxData.java +++ b/src/main/java/ch/njol/skript/entity/FoxData.java @@ -60,7 +60,7 @@ public void set(Fox entity) { @Override protected boolean match(Fox entity) { - return type == entity.getFoxType(); + return type == null || type == entity.getFoxType(); } @Override diff --git a/src/main/java/ch/njol/skript/entity/SimpleEntityData.java b/src/main/java/ch/njol/skript/entity/SimpleEntityData.java index 336b897e8ba..95570d01205 100644 --- a/src/main/java/ch/njol/skript/entity/SimpleEntityData.java +++ b/src/main/java/ch/njol/skript/entity/SimpleEntityData.java @@ -273,7 +273,6 @@ public boolean equals(final @Nullable Object obj) { } if (Skript.isRunningMinecraft(1, 14)) { - types.add(new SimpleEntityDataInfo("fox", Fox.class)); types.add(new SimpleEntityDataInfo("pillager", Pillager.class)); types.add(new SimpleEntityDataInfo("ravager", Ravager.class)); From 0ce3fa4835cee2abc3ac5fc2dafdc3e0e6f09b47 Mon Sep 17 00:00:00 2001 From: ShaneBeee Date: Tue, 8 Oct 2019 11:48:31 -0700 Subject: [PATCH 2/2] FoxData - tests - Added tests to check for deletion of all foxes --- src/test/skript/tests/regressions/2536-FoxData fixes.sk | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/test/skript/tests/regressions/2536-FoxData fixes.sk diff --git a/src/test/skript/tests/regressions/2536-FoxData fixes.sk b/src/test/skript/tests/regressions/2536-FoxData fixes.sk new file mode 100644 index 00000000000..9f6ad4d2ba7 --- /dev/null +++ b/src/test/skript/tests/regressions/2536-FoxData fixes.sk @@ -0,0 +1,5 @@ +test "fox entityData fixes": + spawn red fox at location(0, 64, 0, world "world") + spawn 3 snow foxes at location(0, 64, 0, world "world") + delete all foxes + assert size of all foxes = 0 with "all foxes not deleted:%size of all foxes%" \ No newline at end of file