mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Striders give saddle back
This commit is contained in:
@@ -1,50 +0,0 @@
|
||||
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/net/minecraft/world/entity/monster/Strider.java b/net/minecraft/world/entity/monster/Strider.java
|
||||
index b2f9e7dec710f9a135074d6b5eb438e127a7aaa9..b5bc19ea93058374ce3a01ed650b0396b5e4176d 100644
|
||||
--- a/net/minecraft/world/entity/monster/Strider.java
|
||||
+++ b/net/minecraft/world/entity/monster/Strider.java
|
||||
@@ -485,6 +485,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 012bdd66052eb30a185804a36e4cbde323bb1d68..c0b9a7a7cd1e4acf151b12d308627d4ff2202018 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -1814,6 +1814,7 @@ public class PurpurWorldConfig {
|
||||
public double striderMaxHealth = 20.0D;
|
||||
public double striderScale = 1.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);
|
||||
@@ -1826,6 +1827,7 @@ public class PurpurWorldConfig {
|
||||
striderMaxHealth = getDouble("mobs.strider.attributes.max_health", striderMaxHealth);
|
||||
striderScale = Mth.clamp(getDouble("mobs.strider.attributes.scale", striderScale), 0.0625D, 16.0D);
|
||||
striderBreedingTicks = getInt("mobs.strider.breeding-delay-ticks", striderBreedingTicks);
|
||||
+ striderGiveSaddleBack = getBoolean("mobs.strider.give-saddle-back", striderGiveSaddleBack);
|
||||
}
|
||||
|
||||
public boolean tadpoleRidable = false;
|
||||
Reference in New Issue
Block a user