Files
Purpur/patches/server/0228-Shearing-jeb-produces-random-color-wool.patch
Ben Kerllenevich 1cfcb9f28e fix lots of levels
2023-06-09 00:49:22 -04:00

40 lines
2.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <blake.galbreath@gmail.com>
Date: Fri, 31 Dec 2021 06:03:12 -0600
Subject: [PATCH] Shearing jeb produces random color wool
diff --git a/src/main/java/net/minecraft/world/entity/animal/Sheep.java b/src/main/java/net/minecraft/world/entity/animal/Sheep.java
index a1b323ecba25910e97f154e487acc94943117e0c..62d8ae4c689170420c7850fbbb402be85b565882 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Sheep.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Sheep.java
@@ -315,7 +315,7 @@ public class Sheep extends Animal implements Shearable {
for (int j = 0; j < i; ++j) {
this.forceDrops = true; // CraftBukkit
- ItemEntity entityitem = this.spawnAtLocation((ItemLike) Sheep.ITEM_BY_DYE.get(this.getColor()), 1);
+ ItemEntity entityitem = this.spawnAtLocation((ItemLike) Sheep.ITEM_BY_DYE.get(this.level().purpurConfig.sheepShearJebRandomColor && hasCustomName() && getCustomName().getString().equals("jeb_") ? DyeColor.random(this.level().random) : this.getColor()), 1); // Purpur
this.forceDrops = false; // CraftBukkit
if (entityitem != null) {
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index cbfac77db19cda4c34ddd8ae353bdea9be2a6407..96b7a1e4573d7ee989a0cc95c6527bf5b9211028 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -2305,6 +2305,7 @@ public class PurpurWorldConfig {
public boolean sheepBypassMobGriefing = false;
public boolean sheepTakeDamageFromWater = false;
public boolean sheepAlwaysDropExp = false;
+ public boolean sheepShearJebRandomColor = false;
private void sheepSettings() {
sheepRidable = getBoolean("mobs.sheep.ridable", sheepRidable);
sheepRidableInWater = getBoolean("mobs.sheep.ridable-in-water", sheepRidableInWater);
@@ -2319,6 +2320,7 @@ public class PurpurWorldConfig {
sheepBypassMobGriefing = getBoolean("mobs.sheep.bypass-mob-griefing", sheepBypassMobGriefing);
sheepTakeDamageFromWater = getBoolean("mobs.sheep.takes-damage-from-water", sheepTakeDamageFromWater);
sheepAlwaysDropExp = getBoolean("mobs.sheep.always-drop-exp", sheepAlwaysDropExp);
+ sheepShearJebRandomColor = getBoolean("mobs.sheep.jeb-shear-random-color", sheepShearJebRandomColor);
}
public boolean shulkerRidable = false;