Files
Purpur/patches/server/0041-Pigs-give-saddle-back.patch
William Blake Galbreath 17368d1aa9 Updated Upstream (Paper & Tuinity)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
12dec20 Bump paerweight to 1.1.7
e33ed89 Get short commit ref using a more proper method
7d6147d Remove now unneeded patch due to paperweight 1.1.7
e72fa41 Update task dependency for includeMappings so the new task isn't skipped
0ad5526 Trim whitspace off of git hash (oops)

Tuinity Changes:
e878ba9 Update paper
2bd2849 Bring back fix codec spam patch
2021-06-27 00:42:39 -05:00

50 lines
2.5 KiB
Diff

From 0000000000000000000000000000000000000000 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
diff --git a/src/main/java/net/minecraft/world/entity/animal/Pig.java b/src/main/java/net/minecraft/world/entity/animal/Pig.java
index f4a099e691dce3c57069e76d67859161b459098e..518d28dc0b5b8c04263c93a4347e4c971a1318d8 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Pig.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Pig.java
@@ -173,6 +173,18 @@ public class Pig extends Animal implements ItemSteerable, Saddleable {
if (!flag && this.isSaddled() && !this.isVehicle() && !player.isSecondaryUseActive()) {
if (!this.level.isClientSide) {
+ // Purpur start
+ if (level.purpurConfig.pigGiveSaddleBack && player.isCrouching()) {
+ this.steering.setSaddle(false);
+ if (!player.getAbilities().instabuild) {
+ ItemStack saddle = new ItemStack(Items.SADDLE);
+ if (!player.getInventory().add(saddle)) {
+ player.drop(saddle, false);
+ }
+ }
+ return InteractionResult.SUCCESS;
+ }
+ // Purpur end
player.startRiding(this);
}
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index b85daa6b78e5bc34c5fbee25495ce4e498971fc3..63ec9aee12ccfa08852fe9793008dec984147cd2 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -752,6 +752,7 @@ public class PurpurWorldConfig {
public boolean pigRidable = false;
public boolean pigRidableInWater = false;
public double pigMaxHealth = 10.0D;
+ public boolean pigGiveSaddleBack = false;
private void pigSettings() {
pigRidable = getBoolean("mobs.pig.ridable", pigRidable);
pigRidableInWater = getBoolean("mobs.pig.ridable-in-water", pigRidableInWater);
@@ -761,6 +762,7 @@ public class PurpurWorldConfig {
set("mobs.pig.attributes.max_health", oldValue);
}
pigMaxHealth = getDouble("mobs.pig.attributes.max_health", pigMaxHealth);
+ pigGiveSaddleBack = getBoolean("mobs.pig.give-saddle-back", pigGiveSaddleBack);
}
public boolean piglinRidable = false;