mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
39 lines
1.5 KiB
Diff
39 lines
1.5 KiB
Diff
From 87605ad90c84030a6149c9ff94307907be3a48f9 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 +++++++++++-
|
|
1 file changed, 11 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java
|
|
index 30feec4701..a2d4c2f54b 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityPig.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityPig.java
|
|
@@ -120,10 +120,20 @@ public class EntityPig extends EntityAnimal {
|
|
return true;
|
|
}
|
|
if (hasSaddle() && !isVehicle()) {
|
|
+ if (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;
|
|
+ }
|
|
entityhuman.startRiding(this);
|
|
return true;
|
|
}
|
|
- if (itemstack.getItem() == Items.SADDLE) {
|
|
+ if (itemstack.getItem() == Items.SADDLE && !entityhuman.isSneaking()) {
|
|
itemstack.a(entityhuman, this, enumhand);
|
|
return true;
|
|
}
|
|
--
|
|
2.20.1
|
|
|