mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
56 lines
3.0 KiB
Diff
56 lines
3.0 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/world/entity/animal/SnowGolem.java b/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java
|
|
index 3ffd9dd16c80399842ba138ed60abd66cd312dcb..bd9dd01e9140c2ad0ab9859b9a455f73ab04a253 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java
|
|
@@ -191,6 +191,14 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
|
|
}
|
|
|
|
return InteractionResult.sidedSuccess(this.level().isClientSide);
|
|
+ // Purpur start
|
|
+ } else if (level().purpurConfig.snowGolemPutPumpkinBack && !hasPumpkin() && itemstack.getItem() == Blocks.CARVED_PUMPKIN.asItem()) {
|
|
+ setPumpkin(true);
|
|
+ if (!player.getAbilities().instabuild) {
|
|
+ itemstack.shrink(1);
|
|
+ }
|
|
+ return InteractionResult.SUCCESS;
|
|
+ // Purpur end
|
|
} else {
|
|
return tryRide(player, hand); // Purpur
|
|
}
|
|
@@ -202,6 +210,7 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
|
|
if (!this.level().isClientSide()) {
|
|
this.setPumpkin(false);
|
|
this.forceDrops = true; // CraftBukkit
|
|
+ if (level().purpurConfig.snowGolemDropsPumpkin) // Purpur
|
|
this.spawnAtLocation(new ItemStack(Items.CARVED_PUMPKIN), 1.7F);
|
|
this.forceDrops = false; // CraftBukkit
|
|
}
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index 9060e81e082c402d0792430ce84b5010d2326d45..a25beed0e8bcabf33855bb374091bc64ef6c6a4f 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -1180,6 +1180,8 @@ public class PurpurWorldConfig {
|
|
public boolean snowGolemControllable = true;
|
|
public boolean snowGolemLeaveTrailWhenRidden = false;
|
|
public double snowGolemMaxHealth = 4.0D;
|
|
+ public boolean snowGolemDropsPumpkin = true;
|
|
+ public boolean snowGolemPutPumpkinBack = false;
|
|
private void snowGolemSettings() {
|
|
snowGolemRidable = getBoolean("mobs.snow_golem.ridable", snowGolemRidable);
|
|
snowGolemRidableInWater = getBoolean("mobs.snow_golem.ridable-in-water", snowGolemRidableInWater);
|
|
@@ -1191,6 +1193,8 @@ public class PurpurWorldConfig {
|
|
set("mobs.snow_golem.attributes.max_health", oldValue);
|
|
}
|
|
snowGolemMaxHealth = getDouble("mobs.snow_golem.attributes.max_health", snowGolemMaxHealth);
|
|
+ snowGolemDropsPumpkin = getBoolean("mobs.snow_golem.drop-pumpkin-when-sheared", snowGolemDropsPumpkin);
|
|
+ snowGolemPutPumpkinBack = getBoolean("mobs.snow_golem.pumpkin-can-be-added-back", snowGolemPutPumpkinBack);
|
|
}
|
|
|
|
public boolean snifferRidable = false;
|