Skip to content

Commit 4d854e6

Browse files
committed
Disable MC-163962 fix by default
It changes restocking behavior pretty drastically compared to Vanilla, keep it as a config option for those that want it Fixes #12761
1 parent 57c202e commit 4d854e6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

paper-server/patches/sources/net/minecraft/world/item/trading/MerchantOffer.java.patch

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,11 @@
6363
);
6464
}
6565

66-
@@ -124,7 +_,7 @@
67-
}
66+
@@ -125,6 +_,7 @@
6867

6968
public void updateDemand() {
70-
- this.demand = this.demand + this.uses - (this.maxUses - this.uses);
71-
+ this.demand = Math.max(0, this.demand + this.uses - (this.maxUses - this.uses)); // Paper - Fix MC-163962
69+
this.demand = this.demand + this.uses - (this.maxUses - this.uses);
70+
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().misc.preventNegativeVillagerDemand) this.demand = Math.max(0, this.demand); // Paper - Fix MC-163962
7271
}
7372

7473
public ItemStack assemble() {

paper-server/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ private void postProcess() {
357357
@Comment("Defines how many orbs groups can exist in an area.")
358358
@Constraints.Min(1)
359359
public IntOr.Default xpOrbGroupsPerArea = IntOr.Default.USE_DEFAULT;
360+
@Comment("See Fix MC-163962; prevent villager demand from going negative.")
361+
public boolean preventNegativeVillagerDemand = false;
360362
}
361363

362364
public BlockUpdates blockUpdates;

0 commit comments

Comments
 (0)