mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 08:57:44 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: b75eeca0 Boost light task priority to ensure it doesnt hold up chunk loads 3d2bc848 Ensure VillagerTrades doesn't load async - fixes #3495 e470f1ef Add more information to Timing Reports f4a47db6 Improve Thread Pool usage to allow single threads for single cpu servers a4fe910f Fix sounds when using worldedit regen command 70ad51a8 Updated Upstream (Bukkit/CraftBukkit) d7cfa4fa Improve legacy format serialization more
72 lines
3.6 KiB
Diff
72 lines
3.6 KiB
Diff
From f7ebb12367af42882a2ad9c9cc7e4414197bc40b Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Fri, 3 May 2019 23:58:44 -0500
|
|
Subject: [PATCH] Snowman drop and put back pumpkin
|
|
|
|
---
|
|
.../net/minecraft/server/EntitySnowman.java | 17 +++++++++++++++++
|
|
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 4 ++++
|
|
2 files changed, 21 insertions(+)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java
|
|
index 65d7468997..3f6f8ad454 100644
|
|
--- a/src/main/java/net/minecraft/server/EntitySnowman.java
|
|
+++ b/src/main/java/net/minecraft/server/EntitySnowman.java
|
|
@@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.event.CraftEventFactory;
|
|
|
|
public class EntitySnowman extends EntityGolem implements IRangedEntity {
|
|
|
|
+ private static final RecipeItemStack PUMPKIN = RecipeItemStack.a(Blocks.PUMPKIN.getItem(), Blocks.CARVED_PUMPKIN.getItem(), Blocks.JACK_O_LANTERN.getItem()); // Purpur
|
|
private static final DataWatcherObject<Byte> b = DataWatcher.a(EntitySnowman.class, DataWatcherRegistry.a);
|
|
|
|
public EntitySnowman(EntityTypes<? extends EntitySnowman> entitytypes, World world) {
|
|
@@ -142,9 +143,25 @@ public class EntitySnowman extends EntityGolem implements IRangedEntity {
|
|
itemstack.damage(1, entityhuman, (entityhuman1) -> {
|
|
entityhuman1.broadcastItemBreak(enumhand);
|
|
});
|
|
+ // Purpur start
|
|
+ if (world.purpurConfig.snowGolemDropsPumpkin) {
|
|
+ EntityItem pumpkin = new EntityItem(world, locX(), locY(), locZ(), new ItemStack(Blocks.CARVED_PUMPKIN.getItem()));
|
|
+ pumpkin.pickupDelay = 10;
|
|
+ world.addEntity(pumpkin);
|
|
+ return true;
|
|
+ }
|
|
+ // Purpur end
|
|
}
|
|
|
|
return true;
|
|
+ // Purpur start
|
|
+ } else if (world.purpurConfig.snowGolemPutPumpkinBack && !hasPumpkin() && PUMPKIN.test(itemstack)) {
|
|
+ setHasPumpkin(true);
|
|
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
|
+ itemstack.subtract(1);
|
|
+ }
|
|
+ return true;
|
|
+ // Purpur end
|
|
} else {
|
|
return tryRide(entityhuman, enumhand); // Purpur
|
|
}
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index c9b41cebd6..56b67c4082 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -540,11 +540,15 @@ public class PurpurWorldConfig {
|
|
public boolean snowGolemRidableInWater = false;
|
|
public boolean snowGolemRequireShiftToMount = true;
|
|
public boolean snowGolemLeaveTrailWhenRidden = false;
|
|
+ public boolean snowGolemDropsPumpkin = false;
|
|
+ public boolean snowGolemPutPumpkinBack = false;
|
|
private void snowGolemSettings() {
|
|
snowGolemRidable = getBoolean("mobs.snow_golem.ridable", snowGolemRidable);
|
|
snowGolemRidableInWater = getBoolean("mobs.snow_golem.ridable-in-water", snowGolemRidableInWater);
|
|
snowGolemRequireShiftToMount = getBoolean("mobs.snow_golem.require-shift-to-mount", snowGolemRequireShiftToMount);
|
|
snowGolemLeaveTrailWhenRidden = getBoolean("mobs.snow_golem.leave-trail-when-ridden", snowGolemLeaveTrailWhenRidden);
|
|
+ snowGolemDropsPumpkin = getBoolean("mobs.snow_golem.drop-pumpkin-when-sheared", snowGolemDropsPumpkin);
|
|
+ snowGolemPutPumpkinBack = getBoolean("mobs.snow_golem.pumpkin-can-be-added-back", snowGolemPutPumpkinBack);
|
|
}
|
|
|
|
public boolean spiderRidable = false;
|
|
--
|
|
2.24.0
|
|
|