Paper/src/main/java/net/minecraft/server/InventoryCraftResult.java

97 Zeilen
2.1 KiB
Java

2011-01-29 22:50:29 +01:00
package net.minecraft.server;
// CraftBukkit start
import org.bukkit.craftbukkit.entity.CraftHumanEntity;
import org.bukkit.entity.HumanEntity;
// CraftBukkit end
2011-01-29 22:50:29 +01:00
public class InventoryCraftResult implements IInventory {
private ItemStack[] items = new ItemStack[1];
2011-01-29 22:50:29 +01:00
// CraftBukkit start
private int maxStack = MAX_STACK;
2011-01-29 22:50:29 +01:00
public ItemStack[] getContents() {
return this.items;
2011-01-29 22:50:29 +01:00
}
2012-07-29 09:33:13 +02:00
public org.bukkit.inventory.InventoryHolder getOwner() {
return null; // Result slots don't get an owner
}
// Don't need a transaction; the InventoryCrafting keeps track of it for us
public void onOpen(CraftHumanEntity who) {}
public void onClose(CraftHumanEntity who) {}
public java.util.List<HumanEntity> getViewers() {
return new java.util.ArrayList<HumanEntity>();
}
public void setMaxStackSize(int size) {
maxStack = size;
}
2011-01-29 22:50:29 +01:00
// CraftBukkit end
public InventoryCraftResult() {}
public int getSize() {
2011-02-23 03:37:56 +01:00
return 1;
2011-01-29 22:50:29 +01:00
}
public ItemStack getItem(int i) {
return this.items[0];
2011-01-29 22:50:29 +01:00
}
public String getName() {
2011-01-29 22:50:29 +01:00
return "Result";
}
2013-03-13 23:33:27 +01:00
public boolean c() {
return false;
}
public ItemStack splitStack(int i, int j) {
if (this.items[0] != null) {
ItemStack itemstack = this.items[0];
2011-01-29 22:50:29 +01:00
this.items[0] = null;
2011-01-29 22:50:29 +01:00
return itemstack;
} else {
return null;
}
}
2012-03-01 11:49:23 +01:00
public ItemStack splitWithoutUpdate(int i) {
if (this.items[0] != null) {
ItemStack itemstack = this.items[0];
2012-03-01 11:49:23 +01:00
this.items[0] = null;
2012-03-01 11:49:23 +01:00
return itemstack;
} else {
return null;
}
}
public void setItem(int i, ItemStack itemstack) {
this.items[0] = itemstack;
2011-01-29 22:50:29 +01:00
}
public int getMaxStackSize() {
return maxStack; // CraftBukkit
2011-01-29 22:50:29 +01:00
}
public void update() {}
2011-01-29 22:50:29 +01:00
2013-03-13 23:33:27 +01:00
public boolean a(EntityHuman entityhuman) {
2011-01-29 22:50:29 +01:00
return true;
}
2011-09-15 02:23:52 +02:00
2012-07-29 09:33:13 +02:00
public void startOpen() {}
2011-09-15 02:23:52 +02:00
2013-03-13 23:33:27 +01:00
public void g() {}
public boolean b(int i, ItemStack itemstack) {
return true;
}
2011-01-29 22:50:29 +01:00
}