mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 10:46:05 +03:00
64 lines
1.9 KiB
Diff
64 lines
1.9 KiB
Diff
--- ../src-base/minecraft/net/minecraft/inventory/InventoryBasic.java
|
|
+++ ../src-work/minecraft/net/minecraft/inventory/InventoryBasic.java
|
|
@@ -11,6 +11,14 @@
|
|
import net.minecraftforge.fml.relauncher.Side;
|
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
|
|
+import org.bukkit.Location;
|
|
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
|
|
+import org.bukkit.entity.HumanEntity;
|
|
+
|
|
+//CraftBukkit start
|
|
+
|
|
+// CraftBukkit end
|
|
+
|
|
public class InventoryBasic implements IInventory
|
|
{
|
|
private String inventoryTitle;
|
|
@@ -18,9 +26,45 @@
|
|
private final ItemStack[] inventoryContents;
|
|
private List<IInventoryChangedListener> changeListeners;
|
|
private boolean hasCustomName;
|
|
+ // CraftBukkit start - add fields and methods
|
|
+ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
|
|
+ private int maxStack = MAX_STACK;
|
|
+ protected org.bukkit.inventory.InventoryHolder bukkitOwner;
|
|
+
|
|
+ public ItemStack[] getContents() {
|
|
+ return this.inventoryContents;
|
|
+ }
|
|
+
|
|
+ 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 i) {
|
|
+ maxStack = i;
|
|
+ }
|
|
+
|
|
+ public org.bukkit.inventory.InventoryHolder getOwner() {
|
|
+ return bukkitOwner;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public Location getLocation() {
|
|
+ return null;
|
|
+ }
|
|
|
|
public InventoryBasic(String title, boolean customName, int slotCount)
|
|
{
|
|
+ this(title, customName, slotCount, null);
|
|
+ }
|
|
+ public InventoryBasic(String title, boolean customName, int slotCount, org.bukkit.inventory.InventoryHolder owner) { // Added argument
|
|
this.inventoryTitle = title;
|
|
this.hasCustomName = customName;
|
|
this.slotsCount = slotCount;
|