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 Pufferfish Changes: pufferfish-gg/Pufferfish@c9f4e20 Final 1.20.4 Update pufferfish-gg/Pufferfish@1f3ad02 Final 1.20.4 update, for realzies pufferfish-gg/Pufferfish@b1ab664 Enable SIMD on java 21 pufferfish-gg/Pufferfish@0674c2b 1.21 compiles pufferfish-gg/Pufferfish@98ea973 Fix 1.21 version checkers pufferfish-gg/Pufferfish@68f859c Fix lambda/tick guard patch pufferfish-gg/Pufferfish@eaa18d5 Updated Upstream (Paper) pufferfish-gg/Pufferfish@1d72eea Updated Upstream (Paper) pufferfish-gg/Pufferfish@1d3c743 Update pufferfish version detector stuff pufferfish-gg/Pufferfish@5e30963 Fix crash bug pufferfish-gg/Pufferfish@12571eb Use mojmapped paperclip jar instead (CI only) pufferfish-gg/Pufferfish@4d16ae0 Drop a patch - moonrise includes it pufferfish-gg/Pufferfish@52c2d05 Revert "Drop a patch - moonrise includes it" pufferfish-gg/Pufferfish@bdb56f1 Fix entity interactions with fluids pufferfish-gg/Pufferfish@469e5c1 Updated Upstream (Paper) pufferfish-gg/Pufferfish@d75961f 1.21.1 Update (Updated Upstream (Paper))
89 lines
4.5 KiB
Diff
89 lines
4.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 collar color
|
|
|
|
This allows for the server to set a default collar color when a wolf or cat is tamed.
|
|
Resets to RED when the value is invalid.
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/Cat.java b/src/main/java/net/minecraft/world/entity/animal/Cat.java
|
|
index c8266b1a6b609ef92bd83dcb0e86e3cf47ccce6d..356f3728fdadf8190cd6c806789f4fd70820ec94 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/Cat.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java
|
|
@@ -348,6 +348,14 @@ public class Cat extends TamableAnimal implements VariantHolder<Holder<CatVarian
|
|
return Mth.lerp(tickDelta, this.relaxStateOneAmountO, this.relaxStateOneAmount);
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ public void tame(Player player) {
|
|
+ setCollarColor(level().purpurConfig.catDefaultCollarColor);
|
|
+ super.tame(player);
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
@Nullable
|
|
@Override
|
|
public Cat getBreedOffspring(ServerLevel world, AgeableMob entity) {
|
|
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 d159d573d5f87c31cf61baacbaae193d24ab6801..143717d64651ffd75124973ca7a15fc1fd007da3 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
|
|
@@ -215,6 +215,12 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
|
|
}
|
|
}
|
|
|
|
+ @Override
|
|
+ public void tame(Player player) {
|
|
+ setCollarColor(level().purpurConfig.wolfDefaultCollarColor);
|
|
+ super.tame(player);
|
|
+ }
|
|
+
|
|
@Override
|
|
protected void registerGoals() {
|
|
this.goalSelector.addGoal(1, new FloatGoal(this));
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index c5aa4e74a6a8f796ae3000c970ccc8d589ca4a90..0d5ad3c193841bdb08853ceadeee305471173726 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -656,6 +656,7 @@ public class PurpurWorldConfig {
|
|
public int catSpawnSwampHutScanRange = 16;
|
|
public int catSpawnVillageScanRange = 48;
|
|
public int catBreedingTicks = 6000;
|
|
+ public DyeColor catDefaultCollarColor = DyeColor.RED;
|
|
private void catSettings() {
|
|
catRidable = getBoolean("mobs.cat.ridable", catRidable);
|
|
catRidableInWater = getBoolean("mobs.cat.ridable-in-water", catRidableInWater);
|
|
@@ -671,6 +672,11 @@ public class PurpurWorldConfig {
|
|
catSpawnSwampHutScanRange = getInt("mobs.cat.scan-range-for-other-cats.swamp-hut", catSpawnSwampHutScanRange);
|
|
catSpawnVillageScanRange = getInt("mobs.cat.scan-range-for-other-cats.village", catSpawnVillageScanRange);
|
|
catBreedingTicks = getInt("mobs.cat.breeding-delay-ticks", catBreedingTicks);
|
|
+ try {
|
|
+ catDefaultCollarColor = DyeColor.valueOf(getString("mobs.cat.default-collar-color", catDefaultCollarColor.name()));
|
|
+ } catch (IllegalArgumentException ignore) {
|
|
+ catDefaultCollarColor = DyeColor.RED;
|
|
+ }
|
|
}
|
|
|
|
public boolean caveSpiderRidable = false;
|
|
@@ -2084,6 +2090,7 @@ public class PurpurWorldConfig {
|
|
public boolean wolfControllable = true;
|
|
public double wolfMaxHealth = 8.0D;
|
|
public double wolfScale = 1.0D;
|
|
+ public DyeColor wolfDefaultCollarColor = DyeColor.RED;
|
|
public boolean wolfMilkCuresRabies = true;
|
|
public double wolfNaturalRabid = 0.0D;
|
|
public int wolfBreedingTicks = 6000;
|
|
@@ -2098,6 +2105,11 @@ public class PurpurWorldConfig {
|
|
}
|
|
wolfMaxHealth = getDouble("mobs.wolf.attributes.max_health", wolfMaxHealth);
|
|
wolfScale = Mth.clamp(getDouble("mobs.wolf.attributes.scale", wolfScale), 0.0625D, 16.0D);
|
|
+ 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);
|