mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 01:39:52 +03:00
56 lines
1.5 KiB
Diff
56 lines
1.5 KiB
Diff
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityDispenser.java
|
|
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityDispenser.java
|
|
@@ -1,6 +1,11 @@
|
|
package net.minecraft.tileentity;
|
|
|
|
+import java.util.List;
|
|
import java.util.Random;
|
|
+
|
|
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
|
|
+import org.bukkit.entity.HumanEntity;
|
|
+
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.entity.player.InventoryPlayer;
|
|
import net.minecraft.inventory.Container;
|
|
@@ -17,7 +22,30 @@
|
|
{
|
|
private static final Random RNG = new Random();
|
|
private NonNullList<ItemStack> stacks = NonNullList.<ItemStack>withSize(9, ItemStack.EMPTY);
|
|
-
|
|
+ // CraftBukkit start - add fields and methods
|
|
+ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
|
|
+ private int maxStack = MAX_STACK;
|
|
+
|
|
+ public List<ItemStack> getContents() {
|
|
+ return this.stacks;
|
|
+ }
|
|
+
|
|
+ public void onOpen(CraftHumanEntity who) {
|
|
+ transaction.add(who);
|
|
+ }
|
|
+
|
|
+ public void onClose(CraftHumanEntity who) {
|
|
+ transaction.remove(who);
|
|
+ }
|
|
+
|
|
+ public List<HumanEntity> getViewers() {
|
|
+ return transaction;
|
|
+ }
|
|
+
|
|
+ public void setMaxStackSize(int size) {
|
|
+ maxStack = size;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
public int getSizeInventory()
|
|
{
|
|
return 9;
|
|
@@ -112,7 +140,7 @@
|
|
|
|
public int getInventoryStackLimit()
|
|
{
|
|
- return 64;
|
|
+ return maxStack;
|
|
}
|
|
|
|
public String getGuiID()
|