Files
Purpur/patches/server/0100-Add-vindicator-johnny-spawn-chance.patch
BillyGalbreath 424fcf13bf Updated Upstream (Paper & Tuinity)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
a62238a99 Empty commands shall not be dispatched
60df44b11 Configurable door breaking difficulty

Tuinity Changes:
0d63fa009 Fix skylight propagation on top of non-empty sections again
2021-01-07 07:35:21 -06:00

40 lines
2.0 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 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 9a9d56db381af4d99ebd0bfff54ce5ac04e2d768..affab8e21b8643e9965959561d4f125f75b845b9 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);