Skip to content

Commit

Permalink
Add vindicator johnny spawn chance
Browse files Browse the repository at this point in the history
  • Loading branch information
BillyGalbreath committed Jul 25, 2020
1 parent b0a89f6 commit 6417f2a
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions patches/server/0118-Add-vindicator-johnny-spawn-chance.patch
@@ -0,0 +1,39 @@
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 958f86481a..9b227c8d68 100644
--- a/src/main/java/net/minecraft/server/EntityVindicator.java
+++ b/src/main/java/net/minecraft/server/EntityVindicator.java
@@ -99,6 +99,12 @@ public class EntityVindicator extends EntityIllagerAbstract {
((Navigation) this.getNavigation()).a(true);
this.a(difficultydamagescaler);
this.b(difficultydamagescaler);
+ // Purpur start
+ World world = generatoraccess.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 cb7812741e..f42af3d9f9 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -700,9 +700,11 @@ public class PurpurWorldConfig {

public boolean vindicatorRidable = false;
public boolean vindicatorRidableInWater = false;
+ public double vindicatorJohnnySpawnChance = 0D;
private void vindicatorSettings() {
vindicatorRidable = getBoolean("mobs.vindicator.ridable", vindicatorRidable);
vindicatorRidableInWater = getBoolean("mobs.vindicator.ridable-in-water", vindicatorRidableInWater);
+ vindicatorJohnnySpawnChance = getDouble("mobs.vindicator.johnny.spawn-chance", vindicatorJohnnySpawnChance);
}

public boolean witchRidable = false;

0 comments on commit 6417f2a

Please sign in to comment.