mirror of
https://github.com/PurpurMC/Purpur.git
synced 2025-02-17 13:00:04 +08:00
51 lines
2.7 KiB
Diff
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 b927cbf702ebd92c6d7b49ef62429aa94b7f6c37..ac310f473357c1332ecce47a6e1dd01f8267292e 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -1685,6 +1685,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);
|
|
@@ -1696,6 +1697,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;
|