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 9d314470361b2e17afdadc355c084254e5b03aff..66dab9b4e5ae05deeae11c8588a0b855d8847bdc 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Strider.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Strider.java
@@ -451,6 +451,18 @@ public class Strider extends Animal implements ItemSteerable, Saddleable {
 
         if (!flag && this.isSaddled() && !this.isVehicle() && !player.isSecondaryUseActive()) {
             if (!this.level.isClientSide) {
+                // Purpur start
+                if (level.purpurConfig.striderGiveSaddleBack && 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 317daf176c8ee961c5feaa738b406b8f5a42e1aa..cb5a4a7510245ade742b780c9ffd68e7596abfc9 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -1558,6 +1558,7 @@ public class PurpurWorldConfig {
     public boolean striderRidableInWater = false;
     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);
@@ -1568,6 +1569,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 traderLlamaRidable = false;
