Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Commit b3d0394

Browse files
BillyGalbreathgranny
authored andcommitted
Allow void trading
1 parent 3eedb5c commit b3d0394

3 files changed

Lines changed: 11 additions & 39 deletions

File tree

patches/server/0226-Allow-void-trading.patch

Lines changed: 0 additions & 39 deletions
This file was deleted.

purpur-server/minecraft-patches/sources/net/minecraft/server/level/ServerLevel.java.patch

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,12 @@
161161
this.serverLevelData.setThundering(false, org.bukkit.event.weather.ThunderChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
162162
// CraftBukkit start
163163
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
164+
@@ -2676,7 +_,7 @@
165+
// Spigot start
166+
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
167+
// Paper start - Fix merchant inventory not closing on entity removal
168+
- if (entity.getBukkitEntity() instanceof org.bukkit.inventory.Merchant merchant && merchant.getTrader() != null) {
169+
+ if (!entity.level().purpurConfig.playerVoidTrading && entity.getBukkitEntity() instanceof org.bukkit.inventory.Merchant merchant && merchant.getTrader() != null) { // Purpur - Allow void trading
170+
merchant.getTrader().closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.UNLOADED);
171+
}
172+
// Paper end - Fix merchant inventory not closing on entity removal

purpur-server/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ private void playerNetheriteFireResistance() {
423423
public boolean playerRemoveBindingWithWeakness = false;
424424
public int shiftRightClickRepairsMendingPoints = 0;
425425
public int playerExpPickupDelay = 2;
426+
public boolean playerVoidTrading = false;
426427
private void playerSettings() {
427428
if (PurpurConfig.version < 19) {
428429
boolean oldVal = getBoolean("gameplay-mechanics.player.idle-timeout.mods-target", idleTimeoutTargetPlayer);
@@ -449,6 +450,7 @@ private void playerSettings() {
449450
playerRemoveBindingWithWeakness = getBoolean("gameplay-mechanics.player.curse-of-binding.remove-with-weakness", playerRemoveBindingWithWeakness);
450451
shiftRightClickRepairsMendingPoints = getInt("gameplay-mechanics.player.shift-right-click-repairs-mending-points", shiftRightClickRepairsMendingPoints);
451452
playerExpPickupDelay = getInt("gameplay-mechanics.player.exp-pickup-delay-ticks", playerExpPickupDelay);
453+
playerVoidTrading = getBoolean("gameplay-mechanics.player.allow-void-trading", playerVoidTrading);
452454
}
453455

454456
public boolean silkTouchEnabled = false;

0 commit comments

Comments
 (0)