From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ben Kerllenevich <me@notom3ga.me>
Date: Sun, 13 Dec 2020 20:40:57 -0500
Subject: [PATCH] Striders give saddle back


diff --git a/src/main/java/net/minecraft/server/EntityStrider.java b/src/main/java/net/minecraft/server/EntityStrider.java
index 1bca386b7dea01af88a6c8d8e87ff11a0b21cc7a..964956a0027bf0941ff75d658be760b754772fa0 100644
--- a/src/main/java/net/minecraft/server/EntityStrider.java
+++ b/src/main/java/net/minecraft/server/EntityStrider.java
@@ -381,6 +381,18 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab
 
         if (!flag && this.hasSaddle() && !this.isVehicle() && !entityhuman.eq()) {
             if (!this.world.isClientSide) {
+                // Purpur start
+                if (world.purpurConfig.striderGiveSaddleBack && entityhuman.isSneaking()) {
+                    this.saddleStorage.setSaddle(false);
+                    if (!entityhuman.abilities.canInstantlyBuild) {
+                        ItemStack saddle = new ItemStack(Items.SADDLE);
+                        if (!entityhuman.inventory.pickup(saddle)) {
+                            entityhuman.drop(saddle, false);
+                        }
+                    }
+                    return EnumInteractionResult.SUCCESS;
+                }
+                // Purpur end
                 entityhuman.startRiding(this);
             }
 
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 98211b159564f1674c84a5ec7cce37a1f077af5e..f19da65bcc79bd70bf9b5ac33867e49b6838cb7d 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -1502,11 +1502,13 @@ public class PurpurWorldConfig {
     public boolean striderRidable = false;
     public boolean striderRidableInWater = false;
     public int striderBreedingTicks = 6000;
+    public boolean striderGiveSaddleBack = false;
     public double striderMaxHealth = 20.0D;
     private void striderSettings() {
         striderRidable = getBoolean("mobs.strider.ridable", striderRidable);
         striderRidableInWater = getBoolean("mobs.strider.ridable-in-water", striderRidableInWater);
         striderBreedingTicks = getInt("mobs.strider.breeding-delay-ticks", striderBreedingTicks);
+        striderGiveSaddleBack = getBoolean("mobs.strider.give-saddle-back", striderGiveSaddleBack);
         if (PurpurConfig.version < 10) {
             double oldValue = getDouble("mobs.strider.attributes.max-health", striderMaxHealth);
             set("mobs.strider.attributes.max-health", null);
