mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 17:07:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 7232d8f2a EntityLoadCrossbowEvent#shouldConsumeItem 4740bd6c8 Mark PlayerInventory#getItem as nullable bd9ace578 Add a config option to limit the number of entities of each type to load/save in a chunk (#4792) 6bafeb5a9 Move logic from last patch into correct place 9668118fd disable entity ticking flag after watchdog obliteration
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 c8b0fc1353b56d696d72e5ca1203f5f9b690cf3e..c04771eb454a4d3c04ccda2dfb632d9e029cc02f 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -1484,11 +1484,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);
|