Snowman drop and put back pumpkin

This commit is contained in:
William Blake Galbreath
2025-01-05 14:40:36 -08:00
committed by granny
parent 628a35f045
commit 154d9e5591
4 changed files with 24 additions and 50 deletions

View File

@@ -1124,7 +1124,7 @@ index 8e9ba307a0528eb1aef56bdc0f4ded0e71621253..654f5855e1b69f05205e6a132d79ac94
float f = 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F;
this.playSound(SoundEvents.IRON_GOLEM_REPAIR, 1.0F, f);
diff --git a/net/minecraft/world/entity/animal/MushroomCow.java b/net/minecraft/world/entity/animal/MushroomCow.java
index 12099a5eb45ee21520d3ba68ef26909d5949206d..696b0eb93f8c8fe30f4c2cabadc50de730f93c22 100644
index a8aeb79b1c1413d74a5d18a57bd4ba4beca6039c..1292146341022483f78a9128ef9d7a88089274a0 100644
--- a/net/minecraft/world/entity/animal/MushroomCow.java
+++ b/net/minecraft/world/entity/animal/MushroomCow.java
@@ -55,6 +55,23 @@ public class MushroomCow extends Cow implements Shearable, VariantHolder<Mushroo
@@ -1382,7 +1382,7 @@ index 16cc69b14fba16a5a5dfc05d63a40a5112314031..0cd22002a1af6075be4818a4b351ee71
this.goalSelector.addGoal(2, new SitWhenOrderedToGoal(this));
this.goalSelector.addGoal(2, new FollowOwnerGoal(this, 1.0, 5.0F, 1.0F));
diff --git a/net/minecraft/world/entity/animal/Pig.java b/net/minecraft/world/entity/animal/Pig.java
index d203d9c63c13f40a913235ad78a24a3bf489a083..70c60499a440aa4ac8bbc14d5fa440d9c51e2d82 100644
index bc41155e848b273a6e7e685e8fffa265ff8ba6e0..55628e4299c2d85cabddcad38fc1e40a851d64aa 100644
--- a/net/minecraft/world/entity/animal/Pig.java
+++ b/net/minecraft/world/entity/animal/Pig.java
@@ -56,9 +56,27 @@ public class Pig extends Animal implements ItemSteerable, Saddleable {
@@ -1699,7 +1699,7 @@ index e686c500e4b5f3e7b0e808af8b2e43ddbd163bef..c27bb9e8a4a5e8fdc8ae28dae8203859
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0));
this.goalSelector.addGoal(3, new TemptGoal(this, 1.1, stack -> stack.is(ItemTags.SHEEP_FOOD), false));
diff --git a/net/minecraft/world/entity/animal/SnowGolem.java b/net/minecraft/world/entity/animal/SnowGolem.java
index 8871964fd735178804b95182db1fd6bc1088f69d..320035fd5e7120d58cb7d4432b8e85d92a243d8b 100644
index ac07260c01513fae5a8b9f1fe0f7f2bf113c6c3c..7bd5d82a11dda36389913925406a8a2c8e86abf6 100644
--- a/net/minecraft/world/entity/animal/SnowGolem.java
+++ b/net/minecraft/world/entity/animal/SnowGolem.java
@@ -49,12 +49,31 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
@@ -1751,9 +1751,9 @@ index 8871964fd735178804b95182db1fd6bc1088f69d..320035fd5e7120d58cb7d4432b8e85d9
}
drops = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getDrops());
// Paper end - custom shear drops
@@ -154,7 +174,7 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
@@ -162,7 +182,7 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
return InteractionResult.SUCCESS;
// Purpur end - Snowman drop and put back pumpkin
} else {
- return InteractionResult.PASS;
+ return tryRide(player, hand); // Purpur - Ridables

View File

@@ -0,0 +1,17 @@
--- a/net/minecraft/world/entity/animal/SnowGolem.java
+++ b/net/minecraft/world/entity/animal/SnowGolem.java
@@ -153,6 +_,14 @@
}
return InteractionResult.SUCCESS;
+ // Purpur start - Snowman drop and put back pumpkin
+ } else if (level().purpurConfig.snowGolemPutPumpkinBack && !hasPumpkin() && itemInHand.getItem() == Blocks.CARVED_PUMPKIN.asItem()) {
+ setPumpkin(true);
+ if (!player.getAbilities().instabuild) {
+ itemInHand.shrink(1);
+ }
+ return InteractionResult.SUCCESS;
+ // Purpur end - Snowman drop and put back pumpkin
} else {
return InteractionResult.PASS;
}

View File

@@ -1297,6 +1297,7 @@ public class PurpurWorldConfig {
public boolean snowGolemLeaveTrailWhenRidden = false;
public double snowGolemMaxHealth = 4.0D;
public double snowGolemScale = 1.0D;
public boolean snowGolemPutPumpkinBack = false;
private void snowGolemSettings() {
snowGolemRidable = getBoolean("mobs.snow_golem.ridable", snowGolemRidable);
snowGolemRidableInWater = getBoolean("mobs.snow_golem.ridable-in-water", snowGolemRidableInWater);
@@ -1309,6 +1310,7 @@ public class PurpurWorldConfig {
}
snowGolemMaxHealth = getDouble("mobs.snow_golem.attributes.max_health", snowGolemMaxHealth);
snowGolemScale = Mth.clamp(getDouble("mobs.snow_golem.attributes.scale", snowGolemScale), 0.0625D, 16.0D);
snowGolemPutPumpkinBack = getBoolean("mobs.snow_golem.pumpkin-can-be-added-back", snowGolemPutPumpkinBack);
}
public boolean snifferRidable = false;