mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 02:17:42 +01:00
Reduce ridables patch by using object inheritance more
This commit is contained in:
@@ -1,22 +1,21 @@
|
||||
From 8ecb109d918232b222e2a67747f8df204722dcd0 Mon Sep 17 00:00:00 2001
|
||||
From 95c80f781546d30bbf63b8135e18e1a23933a3d8 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(+)
|
||||
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 50906c5bd..a2ba6ef0a 100644
|
||||
index e51054b23..2b078211d 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) {
|
||||
@@ -118,10 +118,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);
|
||||
@@ -25,10 +24,15 @@ index 50906c5bd..a2ba6ef0a 100644
|
||||
+ }
|
||||
+ }
|
||||
+ return true;
|
||||
+ // Purpur end
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
+ }
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user