Files
Purpur/patches/server/0042-Snowman-drop-and-put-back-pumpkin.patch
BillyGalbreath 296267da93 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
eb11845f8 Fix creating worlds with "invalid" names (Fixes #5331)
e4d8a6279 Implement Keyed on World
bcb63dab7 [CI-SKIP] [Auto] Rebuild Patches
48342b06c Allow signs that are inside of the spawn protection to be right clicked to use their run_command tag
c229f90c1 Add Block#isValidTool
20e709c1d Add recipe to cook events
2dcf8bff4 legacy formatting will be the death of me
f597fea0d legacy formatting is worse than walking around in wet socks
7f72c4675 Use implementation-provided legacy serializer for events
27a8d99ec Adventure 4.7.0
e65bd35a1 Respect teams in legacy chat name if configured (#5321)
b31089a92 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5325)
a52b30814 Fix title swapping fadeIn and stay
54ec85949 Prevent grindstones from overstacking items
d7795080c Fix NPE for AIR in meta operations in ItemStack
2e70796c7 [CI-SKIP] Improve documentation of PreCreatureSpawnEvent (#5244)
7bb92e750 [CI-SKIP] Add JavaDoc links to Tag class pointing to custom Paper tags (#5285)
28cd686bf fix per-world difficulty command (#5306)
be7cde2c7 [CI-SKIP] Always check PATH for JDK (#5315)
2021-03-09 17:52:38 -06:00

52 lines
2.6 KiB
Diff

From 0000000000000000000000000000000000000000 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
diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java
index a11c599a9779aa084a1d7d1b6b3485d5b9c23906..c39f3c06eb199a24f32a5c581e877073b580502c 100644
--- a/src/main/java/net/minecraft/server/EntitySnowman.java
+++ b/src/main/java/net/minecraft/server/EntitySnowman.java
@@ -124,6 +124,14 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt
}
return EnumInteractionResult.a(this.world.isClientSide);
+ // Purpur start
+ } else if (world.purpurConfig.snowGolemPutPumpkinBack && !hasPumpkin() && itemstack.getItem() == Blocks.CARVED_PUMPKIN.getItem()) {
+ setHasPumpkin(true);
+ if (!entityhuman.abilities.canInstantlyBuild) {
+ itemstack.subtract(1);
+ }
+ return EnumInteractionResult.SUCCESS;
+ // Purpur end
} else {
return EnumInteractionResult.PASS;
}
@@ -134,6 +142,7 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt
this.world.playSound((EntityHuman) null, (Entity) this, SoundEffects.ENTITY_SNOW_GOLEM_SHEAR, soundcategory, 1.0F, 1.0F);
if (!this.world.s_()) {
this.setHasPumpkin(false);
+ if (world.purpurConfig.snowGolemDropsPumpkin) // Purpur
this.a(new ItemStack(Items.dj), 1.7F);
}
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 24ef91788ff69004eed1b136a0ceb6176db00e76..609307a409365829e61430da47aa75125afcb8c4 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -208,6 +208,13 @@ public class PurpurWorldConfig {
rabbitNaturalKiller = getDouble("mobs.rabbit.spawn-killer-rabbit-chance", rabbitNaturalKiller);
}
+ public boolean snowGolemDropsPumpkin = true;
+ public boolean snowGolemPutPumpkinBack = false;
+ private void snowGolemSettings() {
+ snowGolemDropsPumpkin = getBoolean("mobs.snow_golem.drop-pumpkin-when-sheared", snowGolemDropsPumpkin);
+ snowGolemPutPumpkinBack = getBoolean("mobs.snow_golem.pumpkin-can-be-added-back", snowGolemPutPumpkinBack);
+ }
+
public int villagerBrainTicks = 1;
public boolean villagerUseBrainTicksOnlyWhenLagging = true;
private void villagerSettings() {