mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 12dec20 Bump paerweight to 1.1.7 e33ed89 Get short commit ref using a more proper method 7d6147d Remove now unneeded patch due to paperweight 1.1.7 e72fa41 Update task dependency for includeMappings so the new task isn't skipped 0ad5526 Trim whitspace off of git hash (oops) Tuinity Changes: e878ba9 Update paper 2bd2849 Bring back fix codec spam patch
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 76e6ea34db3942e9dd7646ad7ca1259f4387a4d8..9096c40ad5784d9097e889f0f43b6cf1f60c0692 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;
|
|
@@ -147,6 +148,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 spawnGroupData;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 1a3ea260a5532db2aa14bab3145f3a00d6683cea..591258b3a8cda4cbe50f2bf0d93d25008f4c8a31 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -1427,6 +1427,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);
|
|
@@ -1436,6 +1437,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;
|