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/world/entity/monster/EntityStrider.java b/src/main/java/net/minecraft/world/entity/monster/EntityStrider.java
index 892aa844a98ae0d192737c6fc6df0a219256a47b..5e4cc99a746d98231bbb71672fbc02431e4fab48 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EntityStrider.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityStrider.java
@@ -448,6 +448,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 a675a19b123e3d8aa2010aa6aaa93344bc301a50..57779ceb3c1e2ff27130e5eba204370a3eb0fe14 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -1516,11 +1516,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);
