From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Fri, 24 Jul 2020 19:38:21 -0500
Subject: [PATCH] Add vindicator johnny spawn chance


diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java
index 4761ddfedeed54e79788a6f60f06a805efd60ab1..23b350f793539672b6990327ed52e9bb3bdbf54e 100644
--- a/src/main/java/net/minecraft/server/EntityVindicator.java
+++ b/src/main/java/net/minecraft/server/EntityVindicator.java
@@ -82,6 +82,12 @@ public class EntityVindicator extends EntityIllagerAbstract {
         ((Navigation) this.getNavigation()).a(true);
         this.a(difficultydamagescaler);
         this.b(difficultydamagescaler);
+        // Purpur start
+        World world = worldaccess.getMinecraftWorld();
+        if (world.purpurConfig.vindicatorJohnnySpawnChance > 0D && random.nextDouble() <= world.purpurConfig.vindicatorJohnnySpawnChance) {
+            setCustomName(new ChatMessage("Johnny"));
+        }
+        // Purpur end
         return groupdataentity1;
     }
 
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 40a248746ea53640697395a155c18215fd2bbe51..87c68707aaab2d0e49d4e9c17de94b28a4324799 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -40,6 +40,11 @@ public class PurpurWorldConfig {
         }
     }
 
+    public double vindicatorJohnnySpawnChance = 0D;
+    private void vindicatorSettings() {
+        vindicatorJohnnySpawnChance = getDouble("mobs.vindicator.johnny.spawn-chance", vindicatorJohnnySpawnChance);
+    }
+
     private ConfigurationSection getConfigurationSection(String path) {
         ConfigurationSection section = PurpurConfig.config.getConfigurationSection("world-settings." + worldName + "." + path);
         return section != null ? section : PurpurConfig.config.getConfigurationSection("world-settings.default." + path);
