mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
Merge in Tuinity patches
This commit is contained in:
52
patches/server/0020-Pigs-give-saddle-back.patch
Normal file
52
patches/server/0020-Pigs-give-saddle-back.patch
Normal file
@@ -0,0 +1,52 @@
|
||||
From d8620f5ada8be71628b2ef0398d06e5c220ef425 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 661dcce49..cc8e832b3 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -399,9 +399,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