mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-21 08:27:36 +01:00
59 lines
1.4 KiB
Diff
59 lines
1.4 KiB
Diff
--- a/net/minecraft/server/TileEntityBarrel.java
|
|
+++ b/net/minecraft/server/TileEntityBarrel.java
|
|
@@ -2,8 +2,55 @@
|
|
|
|
import java.util.Iterator;
|
|
|
|
+// CraftBukkit start
|
|
+import java.util.ArrayList;
|
|
+import java.util.Arrays;
|
|
+import java.util.List;
|
|
+import org.bukkit.Location;
|
|
+import org.bukkit.block.Barrel;
|
|
+import org.bukkit.block.Lectern;
|
|
+import org.bukkit.craftbukkit.block.CraftBlock;
|
|
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
|
|
+import org.bukkit.entity.HumanEntity;
|
|
+import org.bukkit.inventory.InventoryHolder;
|
|
+// CraftBukkit end
|
|
+
|
|
public class TileEntityBarrel extends TileEntityLootable {
|
|
|
|
+ // CraftBukkit start - add fields and methods
|
|
+ public List<HumanEntity> transaction = new ArrayList<>();
|
|
+ private int maxStack = MAX_STACK;
|
|
+
|
|
+ @Override
|
|
+ public List<ItemStack> getContents() {
|
|
+ return this.items;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void onOpen(CraftHumanEntity who) {
|
|
+ transaction.add(who);
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void onClose(CraftHumanEntity who) {
|
|
+ transaction.remove(who);
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public List<HumanEntity> getViewers() {
|
|
+ return transaction;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public int getMaxStackSize() {
|
|
+ return maxStack;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void setMaxStackSize(int i) {
|
|
+ maxStack = i;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
private NonNullList<ItemStack> items;
|
|
private int b;
|
|
|