mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 10:46:05 +03:00
41 lines
1.6 KiB
Diff
41 lines
1.6 KiB
Diff
--- ../src-base/minecraft/net/minecraft/inventory/ContainerMerchant.java
|
|
+++ ../src-work/minecraft/net/minecraft/inventory/ContainerMerchant.java
|
|
@@ -1,6 +1,9 @@
|
|
package net.minecraft.inventory;
|
|
|
|
import javax.annotation.Nullable;
|
|
+
|
|
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
|
|
+
|
|
import net.minecraft.entity.IMerchant;
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.entity.player.InventoryPlayer;
|
|
@@ -14,7 +17,19 @@
|
|
private final IMerchant theMerchant;
|
|
private final InventoryMerchant merchantInventory;
|
|
private final World theWorld;
|
|
+ // CraftBukkit start
|
|
+ private CraftInventoryView bukkitEntity = null;
|
|
+ private InventoryPlayer player;
|
|
|
|
+ @Override
|
|
+ public CraftInventoryView getBukkitView() {
|
|
+ if (bukkitEntity == null) {
|
|
+ bukkitEntity = new CraftInventoryView(this.player.player.getBukkitEntity(), new org.bukkit.craftbukkit.inventory.CraftInventoryMerchant((InventoryMerchant) merchantInventory), this);
|
|
+ }
|
|
+ return bukkitEntity;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+
|
|
public ContainerMerchant(InventoryPlayer playerInventory, IMerchant merchant, World worldIn)
|
|
{
|
|
this.theMerchant = merchant;
|
|
@@ -23,6 +38,7 @@
|
|
this.addSlotToContainer(new Slot(this.merchantInventory, 0, 36, 53));
|
|
this.addSlotToContainer(new Slot(this.merchantInventory, 1, 62, 53));
|
|
this.addSlotToContainer(new SlotMerchantResult(playerInventory.player, merchant, this.merchantInventory, 2, 120, 53));
|
|
+ this.player = playerInventory; // CraftBukkit - save player
|
|
|
|
for (int i = 0; i < 3; ++i)
|
|
{
|