Files
Purpur/patches/server/0231-Shearing-jeb-produces-random-color-wool.patch
2023-06-11 21:55:14 -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 ed178813ce4a467be74cc3d146c0782445ca551a..569dba7fae83989f209f83c1f9da9bf64918139f 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -2286,6 +2286,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);
@@ -2300,6 +2301,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;