mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
Dropped per the advice of Proximyst. Has possible issues if players log in while they are still logging out from another location, with increased risk during lag spikes. A fix/workaround is possible in the future, but for the time being we will just drop this patch to avoid any potential problems.
48 lines
2.6 KiB
Diff
48 lines
2.6 KiB
Diff
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 a0bb64bea373c678c519e3fae8f808fd36e1ee4f..11911b10ddc6e2a681f2eda313a6e7c68674a1ac 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityStrider.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityStrider.java
|
|
@@ -376,6 +376,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 027419b939311aefbf12bfa109306a190ccb699c..700229347f65d1d61cb47620a939d8fcb52599d8 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -1491,11 +1491,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);
|