@@ -1,27 +1,26 @@
|
||||
--- a/net/minecraft/server/TileEntityDispenser.java
|
||||
+++ b/net/minecraft/server/TileEntityDispenser.java
|
||||
@@ -3,12 +3,44 @@
|
||||
import java.util.Random;
|
||||
import javax.annotation.Nullable;
|
||||
@@ -2,12 +2,43 @@
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Random;
|
||||
+// CraftBukkit start
|
||||
+import java.util.List;
|
||||
+
|
||||
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
|
||||
+import org.bukkit.entity.HumanEntity;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class TileEntityDispenser extends TileEntityLootable implements IInventory {
|
||||
|
||||
private static final Random f = new Random();
|
||||
private ItemStack[] items = new ItemStack[9];
|
||||
protected String a;
|
||||
public class TileEntityDispenser extends TileEntityLootable {
|
||||
|
||||
private static final Random a = new Random();
|
||||
private NonNullList<ItemStack> items;
|
||||
|
||||
+ // CraftBukkit start - add fields and methods
|
||||
+ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
|
||||
+ private int maxStack = MAX_STACK;
|
||||
+
|
||||
+ public ItemStack[] getContents() {
|
||||
+ public List<ItemStack> getContents() {
|
||||
+ return this.items;
|
||||
+ }
|
||||
+
|
||||
@@ -42,18 +41,10 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
public TileEntityDispenser() {}
|
||||
|
||||
public int getSize() {
|
||||
@@ -46,6 +78,7 @@
|
||||
|
||||
for (int k = 0; k < this.items.length; ++k) {
|
||||
if (this.items[k] != null && TileEntityDispenser.f.nextInt(j++) == 0) {
|
||||
+ if (this.items[k].count == 0) continue; // CraftBukkit
|
||||
i = k;
|
||||
}
|
||||
}
|
||||
@@ -139,7 +172,7 @@
|
||||
public TileEntityDispenser() {
|
||||
this.items = NonNullList.a(9, ItemStack.a);
|
||||
}
|
||||
@@ -92,7 +123,7 @@
|
||||
}
|
||||
|
||||
public int getMaxStackSize() {
|
||||
@@ -61,4 +52,4 @@
|
||||
+ return maxStack; // CraftBukkit
|
||||
}
|
||||
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
public String getContainerName() {
|
||||
|
||||
Reference in New Issue
Block a user