mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 18:07:43 +01:00
Create patch for decompile fixes
This commit is contained in:
52
patches/server/0019-Pigs-give-saddle-back.patch
Normal file
52
patches/server/0019-Pigs-give-saddle-back.patch
Normal file
@@ -0,0 +1,52 @@
|
||||
From 5d8838ca5a4ba824f22c9ead773e5a1eb4b0c9a6 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 e6a7f8ef37..d78666dbb2 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 c5c59a8c81..992c879dc7 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -403,9 +403,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
|
||||
|
||||
Reference in New Issue
Block a user