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 7da9fcf10e6480a71d7a3e9934bb91320cac227e..6c6e020522261ca5bbc47a59c25d3e98bf0b4007 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 b2851cd99429671d41264b306321552ed2caebef..4a7f80f623d30a3781c04e05aa1bcf57f47caab2 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -1171,6 +1171,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);
|
|
@@ -1182,6 +1184,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;
|