mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 09:27:43 +01:00
Striders give saddle back
This commit is contained in:
@@ -4324,7 +4324,7 @@ index 5fa2b7920a233afb3659b02cbd7ab82307ea9aaf..ed7ba19870a09ac78c1f069040a25e47
|
||||
EntityType<Stray> entityType, ServerLevelAccessor level, EntitySpawnReason spawnReason, BlockPos pos, RandomSource random
|
||||
) {
|
||||
diff --git a/net/minecraft/world/entity/monster/Strider.java b/net/minecraft/world/entity/monster/Strider.java
|
||||
index cbae85171a1bb64ee3be40ba211d88e68bf672e4..15c1608b1a8f4d59b1d2cbc9c113ac3198119fb2 100644
|
||||
index ce690b564ea8ee055823928169fe605893498f3d..78671f02ef28f4a3b796b357d21fb4c9b64c153e 100644
|
||||
--- a/net/minecraft/world/entity/monster/Strider.java
|
||||
+++ b/net/minecraft/world/entity/monster/Strider.java
|
||||
@@ -94,6 +94,23 @@ public class Strider extends Animal implements ItemSteerable, Saddleable {
|
||||
@@ -4359,7 +4359,7 @@ index cbae85171a1bb64ee3be40ba211d88e68bf672e4..15c1608b1a8f4d59b1d2cbc9c113ac31
|
||||
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0));
|
||||
this.temptGoal = new TemptGoal(this, 1.4, itemStack -> itemStack.is(ItemTags.STRIDER_TEMPT_ITEMS), false);
|
||||
this.goalSelector.addGoal(3, this.temptGoal);
|
||||
@@ -424,7 +442,7 @@ public class Strider extends Animal implements ItemSteerable, Saddleable {
|
||||
@@ -437,7 +455,7 @@ public class Strider extends Animal implements ItemSteerable, Saddleable {
|
||||
InteractionResult interactionResult = super.mobInteract(player, hand);
|
||||
if (!interactionResult.consumesAction()) {
|
||||
ItemStack itemInHand = player.getItemInHand(hand);
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
--- a/net/minecraft/world/entity/monster/Strider.java
|
||||
+++ b/net/minecraft/world/entity/monster/Strider.java
|
||||
@@ -414,6 +_,19 @@
|
||||
@Override
|
||||
public InteractionResult mobInteract(Player player, InteractionHand hand) {
|
||||
boolean isFood = this.isFood(player.getItemInHand(hand));
|
||||
+ // Purpur start
|
||||
+ if (level().purpurConfig.striderGiveSaddleBack && player.isSecondaryUseActive() && !isFood && 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 (!isFood && this.isSaddled() && !this.isVehicle() && !player.isSecondaryUseActive()) {
|
||||
if (!this.level().isClientSide) {
|
||||
player.startRiding(this);
|
||||
@@ -1806,6 +1806,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);
|
||||
@@ -1818,6 +1819,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