mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
52 lines
2.8 KiB
Diff
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 c28ed3ae75695d5f4052726a2acf526dde7cd261..ccdbeca6fa964fc2d1b4b25bdd4a218ea13a92df 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -1477,6 +1477,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);
|
|
@@ -1486,6 +1487,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;
|