Commits

Y2K_ authored 08612fb689a
Allow for checkReachable on Merchant Menu
No tags

nms-patches/net/minecraft/world/inventory/ContainerMerchant.patch

Modified
30 30 this(i, playerinventory, new MerchantWrapper(playerinventory.player));
31 31 }
32 32 @@ -43,6 +58,7 @@
33 33 this.addSlot(new Slot(this.tradeContainer, 0, 136, 37));
34 34 this.addSlot(new Slot(this.tradeContainer, 1, 162, 37));
35 35 this.addSlot(new SlotMerchantResult(playerinventory.player, imerchant, this.tradeContainer, 2, 220, 37));
36 36 + this.player = playerinventory; // CraftBukkit - save player
37 37 this.addStandardInventorySlots(playerinventory, 108, 84);
38 38 }
39 39
40 -@@ -143,7 +159,7 @@
40 +@@ -62,6 +78,7 @@
41 +
42 + @Override
43 + public boolean stillValid(EntityHuman entityhuman) {
44 ++ if (!checkReachable) return true; // CraftBukkit checkReachable
45 + return this.trader.stillValid(entityhuman);
46 + }
47 +
48 +@@ -143,7 +160,7 @@
41 49 }
42 50
43 51 private void playTradeSound() {
44 52 - if (!this.trader.isClientSide()) {
45 53 + if (!this.trader.isClientSide() && this.trader instanceof Entity) { // CraftBukkit - SPIGOT-5035
46 54 Entity entity = (Entity) this.trader;
47 55
48 56 entity.level().playLocalSound(entity.getX(), entity.getY(), entity.getZ(), this.trader.getNotifyTradeSound(), SoundCategory.NEUTRAL, 1.0F, 1.0F, false);

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut