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: 1c8b6065e Skip distance map update when spawning is disabled 091e6700f Added PlayerStonecutterRecipeSelectEvent fc885f966 Add toggle for always placing the dragon egg b3a6da3a7 Updated Upstream (Bukkit/CraftBukkit) 18ccc062d [Auto] Updated Upstream (Spigot) e9a87b72b fix BaseTag constructor (#5095)
57 lines
2.8 KiB
Diff
57 lines
2.8 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/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java
|
|
index 5fe2e9f4bfbdc08690eacd6196e59529dc7953e8..fd62dc51258876275adbe02f750fd88107c38a6b 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityWolf.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityWolf.java
|
|
@@ -115,6 +115,12 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable
|
|
this.updatePathfinders(false);
|
|
return super.prepare(worldaccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound);
|
|
}
|
|
+
|
|
+ @Override
|
|
+ public void tame(EntityHuman entityhuman) {
|
|
+ setCollarColor(world.purpurConfig.wolfDefaultCollarColor);
|
|
+ super.tame(entityhuman);
|
|
+ }
|
|
// Purpur end
|
|
|
|
@Override
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index bad50d5d4f6b32fbfe2988471d71e91108a5ffb3..7850a2e674d9c016c02ea5bbf41aaf998a21cbb5 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -3,6 +3,7 @@ package net.pl3x.purpur;
|
|
import com.destroystokyo.paper.PaperConfig;
|
|
import net.minecraft.server.Block;
|
|
import net.minecraft.server.Blocks;
|
|
+import net.minecraft.server.EnumColor;
|
|
import net.minecraft.server.EnumDifficulty;
|
|
import net.minecraft.server.Explosion;
|
|
import net.minecraft.server.IRegistry;
|
|
@@ -1145,12 +1146,18 @@ public class PurpurWorldConfig {
|
|
|
|
public boolean wolfRidable = false;
|
|
public boolean wolfRidableInWater = false;
|
|
+ public EnumColor wolfDefaultCollarColor = EnumColor.RED;
|
|
public boolean wolfMilkCuresRabies = true;
|
|
public double wolfNaturalRabid = 0.0D;
|
|
public int wolfBreedingTicks = 6000;
|
|
private void wolfSettings() {
|
|
wolfRidable = getBoolean("mobs.wolf.ridable", wolfRidable);
|
|
wolfRidableInWater = getBoolean("mobs.wolf.ridable-in-water", wolfRidableInWater);
|
|
+ try {
|
|
+ wolfDefaultCollarColor = EnumColor.valueOf(getString("mobs.wolf.default-collar-color", wolfDefaultCollarColor.name()));
|
|
+ } catch (IllegalArgumentException ignore) {
|
|
+ wolfDefaultCollarColor = EnumColor.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);
|