Files
Purpur/patches/server/0079-Add-vindicator-johnny-spawn-chance.patch
granny 0b95a8072a Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@5436d44 Deprecate several Keyed#getKey methods (#10357)
PaperMC/Paper@a7f1dc6 Change online mode default for Velocity configuration (#10413)
PaperMC/Paper@37db2d7 [ci skip] Update book page/char limit for book meta doc (#10415)
PaperMC/Paper@526795b Update patches to handle vineflower decompiler (#10406)
PaperMC/Paper@8fe90de [ci skip] Referenced InventoryDragEvent in documentation of InventoryClickEvent (#10395)
PaperMC/Paper@46d462b Fix StackOverflowException thrown on shutdown (Fixes #10404) (#10408)
PaperMC/Paper@f061e76 Fix hit criteria advancement triggered before changing state (#10409)
PaperMC/Paper@3263470 Add color transition and clone functions to ParticleBuilder (#10342)
PaperMC/Paper@4445d23 Deprecate ItemStack#setType & add ItemStack#withType (#10290)
2024-04-12 17:48:06 -07:00

44 lines
2.4 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 c5f21eeec60e77167970ed68eec0348912a62e0e..f1acdeb3a851c0d622c5ba8ab760a70a6f97f90e 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Vindicator.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java
@@ -160,6 +160,12 @@ public class Vindicator extends AbstractIllager {
RandomSource randomSource = world.getRandom();
this.populateDefaultEquipmentSlots(randomSource, difficulty);
this.populateDefaultEquipmentEnchantments(randomSource, difficulty);
+ // Purpur start
+ Level level = world.getMinecraftWorld();
+ if (level().purpurConfig.vindicatorJohnnySpawnChance > 0D && random.nextDouble() <= level().purpurConfig.vindicatorJohnnySpawnChance) {
+ setCustomName(Component.translatable("Johnny"));
+ }
+ // Purpur end
return spawnGroupData;
}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index be916fe3a8bc8996be8b0835e3bd8f7920c15055..7b584d5c8460e90dfea250591e4ca36cb1db004a 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -1638,6 +1638,7 @@ public class PurpurWorldConfig {
public boolean vindicatorRidableInWater = true;
public boolean vindicatorControllable = true;
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);
@@ -1648,6 +1649,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;