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

Paper Changes:
c40e04e9e7 Remove wrong update call in distance map add method
58c41d0f60 [ci skip] Update log4j-api in Paper-API to 2.17.1 (#7227)
fa438331e0 [ci skip] Update shadow and remove semicolons from kotlin code
8b1734123e Fix vanilla LocalMobCapCalculator being used when per-player mob spawning is enabled (#7230)
3a43821c38 Updated Upstream (Bukkit/CraftBukkit/Spigot)
4bf2aef745 Validate usernames
3c5284dae9 Allow . in usernames
2022-01-01 16:01:16 -06:00

52 lines
2.8 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/world/entity/monster/Vindicator.java b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java
index c92c948989543248b22db0830a3cb1b6f7940d60..9db267a9a52aa1bde4423711bd0ac6b9949de61b 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Vindicator.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java
@@ -7,6 +7,7 @@ import java.util.function.Predicate;
import javax.annotation.Nullable;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
+import net.minecraft.network.chat.TranslatableComponent;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundEvents;
@@ -146,6 +147,12 @@ public class Vindicator extends AbstractIllager {
((GroundPathNavigation) this.getNavigation()).setCanOpenDoors(true);
this.populateDefaultEquipmentSlots(difficulty);
this.populateDefaultEquipmentEnchantments(difficulty);
+ // Purpur start
+ Level level = world.getMinecraftWorld();
+ if (level.purpurConfig.vindicatorJohnnySpawnChance > 0D && random.nextDouble() <= level.purpurConfig.vindicatorJohnnySpawnChance) {
+ setCustomName(new TranslatableComponent("Johnny"));
+ }
+ // Purpur end
return groupdataentity1;
}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index e0e95b0956a0ee2f7f22bd04fb4d7d5b19868ebe..59b32ac760bc267182d1a6691ef18665d8d3dc15 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -1456,6 +1456,7 @@ public class PurpurWorldConfig {
public boolean vindicatorRidable = false;
public boolean vindicatorRidableInWater = false;
public double vindicatorMaxHealth = 24.0D;
+ public double vindicatorJohnnySpawnChance = 0D;
private void vindicatorSettings() {
vindicatorRidable = getBoolean("mobs.vindicator.ridable", vindicatorRidable);
vindicatorRidableInWater = getBoolean("mobs.vindicator.ridable-in-water", vindicatorRidableInWater);
@@ -1465,6 +1466,7 @@ public class PurpurWorldConfig {
set("mobs.vindicator.attributes.max_health", oldValue);
}
vindicatorMaxHealth = getDouble("mobs.vindicator.attributes.max_health", vindicatorMaxHealth);
+ vindicatorJohnnySpawnChance = getDouble("mobs.vindicator.johnny.spawn-chance", vindicatorJohnnySpawnChance);
}
public boolean wanderingTraderRidable = false;