From 3b580e8aa9ea24148ad0db9c3c8ea015f28e4f3c Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 12 Oct 2018 02:09:53 -0500 Subject: [PATCH] Here's Johnny! (#1563) Adds Johnny API to Vindicator --- Spigot-API-Patches/0162-Here-s-Johnny.patch | 45 +++++++++++++++++++ .../0390-Here-s-Johnny.patch | 41 +++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 Spigot-API-Patches/0162-Here-s-Johnny.patch create mode 100644 Spigot-Server-Patches/0390-Here-s-Johnny.patch diff --git a/Spigot-API-Patches/0162-Here-s-Johnny.patch b/Spigot-API-Patches/0162-Here-s-Johnny.patch new file mode 100644 index 0000000000..d83d3767e6 --- /dev/null +++ b/Spigot-API-Patches/0162-Here-s-Johnny.patch @@ -0,0 +1,45 @@ +From 11cd00a4ed9f1c168842b3fe90c2a16c07241e1f Mon Sep 17 00:00:00 2001 +From: BillyGalbreath +Date: Fri, 12 Oct 2018 01:37:16 -0500 +Subject: [PATCH] Here's Johnny! + + +diff --git a/src/main/java/org/bukkit/entity/Vindicator.java b/src/main/java/org/bukkit/entity/Vindicator.java +index b8ea68a8..c5d9e76a 100644 +--- a/src/main/java/org/bukkit/entity/Vindicator.java ++++ b/src/main/java/org/bukkit/entity/Vindicator.java +@@ -3,4 +3,30 @@ package org.bukkit.entity; + /** + * Represents a Vindicator. + */ +-public interface Vindicator extends Illager { } ++public interface Vindicator extends Illager { ++ // Paper start ++ /** ++ * Check if this Vindicator is set to Johnny mode. ++ *

++ * When in Johnny mode the Vindicator will be hostile to any kind of mob, except ++ * for evokers, ghasts, illusioners and other vindicators. It will even be hostile ++ * to vexes. All mobs, except for endermites, phantoms, guardians, slimes and ++ * magma cubes, will try to attack the vindicator in return. ++ * ++ * @return True if in Johnny mode ++ */ ++ boolean isJohnny(); ++ ++ /** ++ * Set this Vindicator's Johnny mode. ++ *

++ * When in Johnny mode the Vindicator will be hostile to any kind of mob, except ++ * for evokers, ghasts, illusioners and other vindicators. It will even be hostile ++ * to vexes. All mobs, except for endermites, phantoms, guardians, slimes and ++ * magma cubes, will try to attack the vindicator in return. ++ * ++ * @param johnny True to enable Johnny mode ++ */ ++ void setJohnny(boolean johnny); ++ // Paper end ++} +-- +2.19.1 + diff --git a/Spigot-Server-Patches/0390-Here-s-Johnny.patch b/Spigot-Server-Patches/0390-Here-s-Johnny.patch new file mode 100644 index 0000000000..c50efec5a8 --- /dev/null +++ b/Spigot-Server-Patches/0390-Here-s-Johnny.patch @@ -0,0 +1,41 @@ +From db673c8f4f7236d6433caf60ba77cd7bd65b5db7 Mon Sep 17 00:00:00 2001 +From: BillyGalbreath +Date: Fri, 12 Oct 2018 01:37:22 -0500 +Subject: [PATCH] Here's Johnny! + + +diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java +index 597878e2c..4e59df891 100644 +--- a/src/main/java/net/minecraft/server/EntityVindicator.java ++++ b/src/main/java/net/minecraft/server/EntityVindicator.java +@@ -4,7 +4,7 @@ import java.util.function.Predicate; + import javax.annotation.Nullable; + + public class EntityVindicator extends EntityIllagerAbstract { +- private boolean b; ++ private boolean b; public boolean isJohnny() { return b; } public void setJohnny(boolean johnny) { b = johnny; } // Paper - OBFHELPER + private static final Predicate c = (entity) -> { + return entity instanceof EntityLiving && ((EntityLiving)entity).df(); + }; +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java +index 951d47929..5ff957ced 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java +@@ -25,4 +25,14 @@ public class CraftVindicator extends CraftIllager implements Vindicator { + public EntityType getType() { + return EntityType.VINDICATOR; + } ++ ++ // Paper start ++ public boolean isJohnny() { ++ return getHandle().isJohnny(); ++ } ++ ++ public void setJohnny(boolean johnny) { ++ getHandle().setJohnny(johnny); ++ } ++ // Paper end + } +-- +2.19.1 +