Files
Purpur/patches/server/0106-Add-vindicator-johnny-spawn-chance.patch
BillyGalbreath b8fb7ff5b5 Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly

Paper Changes:
821ce25d9 Significantly improve performance of the end generation
2b2e4fd65 Add Wandering Trader spawn rate config options
7263cbca7 [CI-SKIP] [Auto] Rebuild Patches
1c63aff6d Villager resetOffers API
8d8d74a5f Patch 2 references an invalid variable
e6d7bdca1 [CI-SKIP] fixed sed -i for bsd sed (#4782)
7ae47d4eb [CI-SKIP] Remove Waving banner fix (#4786)
2020-11-19 21:31:10 -06:00

40 lines
1.9 KiB
Diff

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 c0d26aa9d..8f812aa91 100644
--- a/src/main/java/net/minecraft/server/EntityVindicator.java
+++ b/src/main/java/net/minecraft/server/EntityVindicator.java
@@ -81,6 +81,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 5db43c331..0330ad619 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);