Commits
30 30 | this(i, playerinventory, new MerchantWrapper(playerinventory.player)); |
31 31 | } |
32 32 | |
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 - | |
40 + | |
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 + | |
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); |