mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
35 lines
1.4 KiB
Diff
35 lines
1.4 KiB
Diff
From 8ecb109d918232b222e2a67747f8df204722dcd0 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 | 11 +++++++++++
|
|
1 file changed, 11 insertions(+)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java
|
|
index 50906c5bd..a2ba6ef0a 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityPig.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityPig.java
|
|
@@ -137,6 +137,17 @@ public class EntityPig extends EntityAnimal {
|
|
} else if (itemstack.getItem() == Items.SADDLE) {
|
|
itemstack.a(entityhuman, (EntityLiving) this, enumhand);
|
|
return true;
|
|
+ // Purpur start - get saddle back
|
|
+ } else if (hasSaddle() && entityhuman.isSneaking() && itemstack.getItem() == Items.AIR) {
|
|
+ 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
|
|
} else {
|
|
return false;
|
|
}
|
|
--
|
|
2.20.1
|
|
|