Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b0a89f6
commit 6417f2a
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
patches/server/0118-Add-vindicator-johnny-spawn-chance.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |