@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/inventory/ContainerDispenser.java
|
||||
+++ b/net/minecraft/world/inventory/ContainerDispenser.java
|
||||
@@ -6,9 +6,18 @@
|
||||
@@ -6,6 +6,11 @@
|
||||
import net.minecraft.world.entity.player.PlayerInventory;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
@@ -11,7 +11,11 @@
|
||||
+
|
||||
public class ContainerDispenser extends Container {
|
||||
|
||||
public final IInventory items;
|
||||
private static final int SLOT_COUNT = 9;
|
||||
@@ -14,6 +19,10 @@
|
||||
private static final int USE_ROW_SLOT_START = 36;
|
||||
private static final int USE_ROW_SLOT_END = 45;
|
||||
public final IInventory dispenser;
|
||||
+ // CraftBukkit start
|
||||
+ private CraftInventoryView bukkitEntity = null;
|
||||
+ private PlayerInventory player;
|
||||
@@ -19,28 +23,28 @@
|
||||
|
||||
public ContainerDispenser(int i, PlayerInventory playerinventory) {
|
||||
this(i, playerinventory, new InventorySubcontainer(9));
|
||||
@@ -16,6 +25,10 @@
|
||||
@@ -21,6 +30,10 @@
|
||||
|
||||
public ContainerDispenser(int i, PlayerInventory playerinventory, IInventory iinventory) {
|
||||
super(Containers.GENERIC_3X3, i);
|
||||
super(Containers.GENERIC_3x3, i);
|
||||
+ // CraftBukkit start - Save player
|
||||
+ this.player = playerinventory;
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
a(iinventory, 9);
|
||||
this.items = iinventory;
|
||||
this.dispenser = iinventory;
|
||||
iinventory.startOpen(playerinventory.player);
|
||||
@@ -43,6 +56,7 @@
|
||||
@@ -48,6 +61,7 @@
|
||||
|
||||
@Override
|
||||
public boolean canUse(EntityHuman entityhuman) {
|
||||
+ if (!this.checkReachable) return true; // CraftBukkit
|
||||
return this.items.a(entityhuman);
|
||||
return this.dispenser.a(entityhuman);
|
||||
}
|
||||
|
||||
@@ -84,4 +98,17 @@
|
||||
@@ -89,4 +103,17 @@
|
||||
super.b(entityhuman);
|
||||
this.items.closeContainer(entityhuman);
|
||||
this.dispenser.closeContainer(entityhuman);
|
||||
}
|
||||
+
|
||||
+ // CraftBukkit start
|
||||
@@ -50,7 +54,7 @@
|
||||
+ return bukkitEntity;
|
||||
+ }
|
||||
+
|
||||
+ CraftInventory inventory = new CraftInventory(this.items);
|
||||
+ CraftInventory inventory = new CraftInventory(this.dispenser);
|
||||
+ bukkitEntity = new CraftInventoryView(this.player.player.getBukkitEntity(), inventory, this);
|
||||
+ return bukkitEntity;
|
||||
+ }
|
||||
|
||||
Reference in New Issue
Block a user