mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 09:27:43 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: cc001a73b Climbing should not bypass cramming gamerule b9930b39d Add legacy plugin count to metrics 4729e6b90 Add more lightning API 5e220bcb5 [ci skip] add stale bot configuration 2a44498a5 Add PlayerItemCooldownEvent fd33bcee1 Add LivingEntity#clearActiveItem a99e0ca05 Fix Player spawnParticle x/y/z precision loss
63 lines
3.2 KiB
Diff
63 lines
3.2 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 48997367a6..95ee716fc9 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 IShearable, 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) {
|
|
@@ -120,9 +121,25 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt
|
|
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 EnumInteractionResult.SUCCESS;
|
|
+ }
|
|
+ // Purpur end
|
|
}
|
|
|
|
return EnumInteractionResult.a(this.world.isClientSide);
|
|
+ // Purpur start
|
|
+ } else if (world.purpurConfig.snowGolemPutPumpkinBack && !hasPumpkin() && PUMPKIN.test(itemstack)) {
|
|
+ setHasPumpkin(true);
|
|
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
|
+ itemstack.subtract(1);
|
|
+ }
|
|
+ return EnumInteractionResult.SUCCESS;
|
|
+ // Purpur end
|
|
} else {
|
|
return EnumInteractionResult.PASS;
|
|
}
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 7d6c624ac2..c91f007044 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -198,6 +198,13 @@ public class PurpurWorldConfig {
|
|
rabbitNaturalKiller = getDouble("mobs.rabbit.spawn-killer-rabbit-chance", rabbitNaturalKiller);
|
|
}
|
|
|
|
+ public boolean snowGolemDropsPumpkin = false;
|
|
+ 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() {
|