mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
44 lines
2.4 KiB
Diff
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 fece613e9c182c6658f9df1d333a5b7e1e862218..a3db9c351b9cb06340458811c006d53796d96ab5 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/Vindicator.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java
|
|
@@ -154,6 +154,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 2cf49e7cb1d128c9dfec76c33d2c9a88c09ae2ca..008ae05e639b38a28d27a6dacbb6ef25a5c9ecbf 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;
|