mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes:415f7ca165Updated Upstream (Bukkit/CraftBukkit)37df95b189refactor: do not import List; use FQN5c65546f5crebasefdef125b19Expose EntityType#getTranslationKey4d9b14efa4Use AsyncAppender instead of AsyncLoggerContextSelector to keep loggging IO off main thread (#6381)8c2adf8e9eAdd warning to getOfflinePlayers (#6365)370b60de14Optimize indirect passenger iteration (#6366)80836709e7Fix block drops position losing precision millions of blocks out (#6387)e942509e73Updated Upstream (Bukkit/CraftBukkit/Spigot) (#6379)ce43ce8265Make EntityUnleashEvent cancellable (#4993)591cac3685Configurable item frame map cursor interval (#6385)e9aa9ce66bAdd config migration for named entity death logging option (#6390)c2f47a76aeImplement Translatable in appropriate places (#6248)f12a7f57e1Clear 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:6fd7e2b376Update paper
50 lines
2.5 KiB
Diff
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);
|