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: df0d7b0d Update upstream CB 6ea3c2cf [CI-SKIP] Rebuild patches d7bed4cb Heavily optimise random block ticking (#2914) b66d9ff8 Update upstream CB ba71c5d6 Stop stripping private use block Unicode from signs 28d9dcfc Entity Jump API (#1587) 9976a768 Fix PlayerNaturallySpawnCreaturesEvent boolean inversion 054e20da Clean up imports on ThrownEggHatchEvent a8984ccb Add ThrownEggHatchEvent (#1982) 9f24d495 Allow nerfed blazes, endermen to take water damage (#2847)
53 lines
2.1 KiB
Diff
53 lines
2.1 KiB
Diff
From 78953ea9b97497921abe3037d7435d0b6c9fbd9b Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Sun, 12 May 2019 01:14:46 -0500
|
|
Subject: [PATCH] Pigs give saddle back
|
|
|
|
---
|
|
src/main/java/net/minecraft/server/EntityPig.java | 12 ++++++++++++
|
|
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
|
2 files changed, 14 insertions(+)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java
|
|
index e6a7f8ef3..d78666dbb 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityPig.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityPig.java
|
|
@@ -135,6 +135,18 @@ public class EntityPig extends EntityAnimal {
|
|
return true;
|
|
}
|
|
if (hasSaddle() && !isVehicle()) {
|
|
+ // Purpur start
|
|
+ if (world.purpurConfig.pigGiveSaddleBack && entityhuman.isSneaking()) {
|
|
+ setSaddle(false);
|
|
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
|
+ ItemStack saddle = new ItemStack(Items.SADDLE);
|
|
+ if (!entityhuman.inventory.pickup(saddle)) {
|
|
+ entityhuman.drop(saddle, false);
|
|
+ }
|
|
+ }
|
|
+ return true;
|
|
+ }
|
|
+ // Purpur end
|
|
entityhuman.startRiding(this);
|
|
return true;
|
|
}
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 88aa21fe4..cd3b29ef1 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -396,9 +396,11 @@ public class PurpurWorldConfig {
|
|
|
|
public boolean pigRidable = false;
|
|
public boolean pigRidableInWater = false;
|
|
+ public boolean pigGiveSaddleBack = false;
|
|
private void pigSettings() {
|
|
pigRidable = getBoolean("mobs.pig.ridable", pigRidable);
|
|
pigRidableInWater = getBoolean("mobs.pig.ridable-in-water", pigRidableInWater);
|
|
+ pigGiveSaddleBack = getBoolean("mobs.pig.give-saddle-back", pigGiveSaddleBack);
|
|
}
|
|
|
|
public boolean pillagerRidable = false;
|
|
--
|
|
2.24.0
|
|
|