Files
Purpur/patches/server/0125-Striders-give-saddle-back.patch
BillyGalbreath 47dc2e92f5 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@55a16d8 Fix Varint21FrameDecoder cached length buf usage
PaperMC/Paper@e6e37ba Add api to resolve components (#7648)
PaperMC/Paper@7168438 [ci skip] Rework workflows to support optional paperclip build (#8583)
PaperMC/Paper@da230d5 More vanilla friendly methods to update trades (#8478)
PaperMC/Paper@8aff07a Add /paper dumplisteners command (#8507)
PaperMC/Paper@b8919a7 pr command action fixes (#8591)
PaperMC/Paper@185fa48 Fix chest relooting mechanics (#8580)
PaperMC/Paper@b4beac0 Fixes potential issues arising from optimizing getPlayerByUUID (#8585)
PaperMC/Paper@f637b1a Fix async entity add due to fungus trees (#7626)
PaperMC/Paper@414ea80 ItemStack damage API (#7801)
PaperMC/Paper@d98c370 Add displayName methods for advancements (#8584)
PaperMC/Paper@44bb599 Add Tick TemporalUnit (#5445)
PaperMC/Paper@9f7eef8 Friction API (#6611)
PaperMC/Paper@4048d3e Allow using degrees for ArmorStand rotations (#7847)
PaperMC/Paper@f59c802 Schoolable Fish API (#7089)
PaperMC/Paper@21b964a Added ability to control player's insomnia and phantoms spawning (#6500)
PaperMC/Paper@f1583fc Add `/paper dumplisteners tofile` and increase detail of command output (#8592)
2022-11-26 18:48:36 -06:00

51 lines
2.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ben Kerllenevich <ben@omega24.dev>
Date: Sun, 13 Dec 2020 20:40:57 -0500
Subject: [PATCH] Striders give saddle back
diff --git a/src/main/java/net/minecraft/world/entity/monster/Strider.java b/src/main/java/net/minecraft/world/entity/monster/Strider.java
index eb2083d67f9486a24d2f0aa4bf1f5ba8a00e23a3..df9d16a6493a57b6034cd56bf8dbe38fe7c5cda1 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Strider.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Strider.java
@@ -455,6 +455,19 @@ public class Strider extends Animal implements ItemSteerable, Saddleable {
public InteractionResult mobInteract(Player player, InteractionHand hand) {
boolean flag = this.isFood(player.getItemInHand(hand));
+ // Purpur start
+ if (level.purpurConfig.striderGiveSaddleBack && player.isSecondaryUseActive() && !flag && isSaddled() && !isVehicle()) {
+ 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
+
if (!flag && this.isSaddled() && !this.isVehicle() && !player.isSecondaryUseActive()) {
if (!this.level.isClientSide) {
player.startRiding(this);
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 397edb048462b9162ec8d9d62d53c3530d59b36a..ec34d409156e22666c3a5cd4b9dc1546af594d5d 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -1676,6 +1676,7 @@ public class PurpurWorldConfig {
public boolean striderControllable = true;
public double striderMaxHealth = 20.0D;
public int striderBreedingTicks = 6000;
+ public boolean striderGiveSaddleBack = false;
private void striderSettings() {
striderRidable = getBoolean("mobs.strider.ridable", striderRidable);
striderRidableInWater = getBoolean("mobs.strider.ridable-in-water", striderRidableInWater);
@@ -1687,6 +1688,7 @@ public class PurpurWorldConfig {
}
striderMaxHealth = getDouble("mobs.strider.attributes.max_health", striderMaxHealth);
striderBreedingTicks = getInt("mobs.strider.breeding-delay-ticks", striderBreedingTicks);
+ striderGiveSaddleBack = getBoolean("mobs.strider.give-saddle-back", striderGiveSaddleBack);
}
public boolean tadpoleRidable = false;