mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 10:27:44 +01:00
save stuff here
This commit is contained in:
@@ -5,14 +5,14 @@ Subject: [PATCH] Pigs give saddle back
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Pig.java b/src/main/java/net/minecraft/world/entity/animal/Pig.java
|
||||
index 26fe9e59e2321932c5ef70631510967162c0d896..2bd72ba2112c7212f331e6ca2655f557eee241d9 100644
|
||||
index a22e5b6c13b48b46d16a859531d4231376bc1bfc..ff98a81f7104bbaf67ed85b8ad0946edf2a8c368 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Pig.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Pig.java
|
||||
@@ -174,6 +174,17 @@ public class Pig extends Animal implements ItemSteerable, Saddleable {
|
||||
public InteractionResult mobInteract(Player player, InteractionHand hand) {
|
||||
boolean flag = this.isFood(player.getItemInHand(hand));
|
||||
|
||||
+ if (level.purpurConfig.pigGiveSaddleBack && player.isSecondaryUseActive() && !flag && isSaddled() && !isVehicle()) {
|
||||
+ if (level().purpurConfig.pigGiveSaddleBack && player.isSecondaryUseActive() && !flag && isSaddled() && !isVehicle()) {
|
||||
+ this.steering.setSaddle(false);
|
||||
+ if (!player.getAbilities().instabuild) {
|
||||
+ ItemStack saddle = new ItemStack(Items.SADDLE);
|
||||
@@ -27,22 +27,22 @@ index 26fe9e59e2321932c5ef70631510967162c0d896..2bd72ba2112c7212f331e6ca2655f557
|
||||
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 b3f8077b7a27a0298d88a651cb93b4028f2621ee..6cea8e16efb059ce2bc477a141d8807c2ea202ba 100644
|
||||
index ed32ff8a2ab16226a8679daff5835cc819b3b709..8b4bedef0c02f72b07400564976ac55380291efc 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -661,6 +661,7 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
|
||||
@@ -918,6 +918,7 @@ public class PurpurWorldConfig {
|
||||
public boolean pigRidableInWater = false;
|
||||
public boolean pigControllable = true;
|
||||
public double pigMaxHealth = 10.0D;
|
||||
+ public boolean pigGiveSaddleBack = false;
|
||||
private void pigSettings() {
|
||||
if (PurpurConfig.version < 10) {
|
||||
double oldValue = getDouble("mobs.pig.attributes.max-health", pigMaxHealth);
|
||||
@@ -668,6 +669,7 @@ public class PurpurWorldConfig {
|
||||
pigRidable = getBoolean("mobs.pig.ridable", pigRidable);
|
||||
pigRidableInWater = getBoolean("mobs.pig.ridable-in-water", pigRidableInWater);
|
||||
@@ -928,6 +929,7 @@ public class PurpurWorldConfig {
|
||||
set("mobs.pig.attributes.max_health", oldValue);
|
||||
}
|
||||
pigMaxHealth = getDouble("mobs.pig.attributes.max_health", pigMaxHealth);
|
||||
+ pigGiveSaddleBack = getBoolean("mobs.pig.give-saddle-back", pigGiveSaddleBack);
|
||||
}
|
||||
|
||||
public double piglinMaxHealth = 16.0D;
|
||||
public boolean piglinRidable = false;
|
||||
|
||||
Reference in New Issue
Block a user