Files
Purpur/patches/server/0138-Configurable-default-wolf-collar-color.patch
William Blake Galbreath 635d108ae2 Updated Upstream (Paper & Tuinity)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
415f7ca165 Updated Upstream (Bukkit/CraftBukkit)
37df95b189 refactor: do not import List; use FQN
5c65546f5c rebase
fdef125b19 Expose EntityType#getTranslationKey
4d9b14efa4 Use AsyncAppender instead of AsyncLoggerContextSelector to keep loggging IO off main thread (#6381)
8c2adf8e9e Add warning to getOfflinePlayers (#6365)
370b60de14 Optimize indirect passenger iteration (#6366)
80836709e7 Fix block drops position losing precision millions of blocks out (#6387)
e942509e73 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#6379)
ce43ce8265 Make EntityUnleashEvent cancellable (#4993)
591cac3685 Configurable item frame map cursor interval (#6385)
e9aa9ce66b Add config migration for named entity death logging option (#6390)
c2f47a76ae Implement Translatable in appropriate places (#6248)
f12a7f57e1 Clear bucket NBT after dispense (#6391)
4dd33cb8b6 [ci skip] Drop "Fix CME on adding a passenger in CreatureSpawnEvent" (#6384)
565cd3306c [ci skip] Add some helper methods to the ObfHelper util class (#6374)

Tuinity Changes:
6fd7e2b376 Update paper
2021-08-14 16:40:13 -05:00

50 lines
2.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Encode42 <me@encode42.dev>
Date: Thu, 10 Dec 2020 13:43:28 -0500
Subject: [PATCH] Configurable default wolf collar color
This allows for the server to set a default collar color when a wolf is tamed.
Resets to RED when the value is invalid.
diff --git a/src/main/java/net/minecraft/world/entity/animal/Wolf.java b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
index 3e7409ebf1f94b9cf55f2d0b0fe17ca8ec44659f..518dd0e6b4889c049e438b393baa795a5eac3e7d 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
@@ -188,6 +188,12 @@ public class Wolf extends TamableAnimal implements NeutralMob {
this.updatePathfinders(false);
return super.finalizeSpawn(world, difficulty, type, data, nbt);
}
+
+ @Override
+ public void tame(Player player) {
+ setCollarColor(level.purpurConfig.wolfDefaultCollarColor);
+ super.tame(player);
+ }
// Purpur end
@Override
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 46338c0dcbe2edc03bb755950475bee95ff6602a..d43e3d9ffdf24e00eeec589ab95edaa75d860338 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -1768,6 +1768,7 @@ public class PurpurWorldConfig {
public boolean wolfRidable = false;
public boolean wolfRidableInWater = false;
public double wolfMaxHealth = 8.0D;
+ public DyeColor wolfDefaultCollarColor = DyeColor.RED;
public boolean wolfMilkCuresRabies = true;
public double wolfNaturalRabid = 0.0D;
public int wolfBreedingTicks = 6000;
@@ -1780,6 +1781,11 @@ public class PurpurWorldConfig {
set("mobs.wolf.attributes.max_health", oldValue);
}
wolfMaxHealth = getDouble("mobs.wolf.attributes.max_health", wolfMaxHealth);
+ try {
+ wolfDefaultCollarColor = DyeColor.valueOf(getString("mobs.wolf.default-collar-color", wolfDefaultCollarColor.name()));
+ } catch (IllegalArgumentException ignore) {
+ wolfDefaultCollarColor = DyeColor.RED;
+ }
wolfMilkCuresRabies = getBoolean("mobs.wolf.milk-cures-rabid-wolves", wolfMilkCuresRabies);
wolfNaturalRabid = getDouble("mobs.wolf.spawn-rabid-chance", wolfNaturalRabid);
wolfBreedingTicks = getInt("mobs.wolf.breeding-delay-ticks", wolfBreedingTicks);