blob: 98858d5fae7a176233019cf701d72d5fd6369073 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
package net.minecraft.server;
// CraftBukkit start
import java.util.ArrayList;
import java.util.List;
import org.bukkit.craftbukkit.entity.CraftHumanEntity;
import org.bukkit.entity.HumanEntity;
import org.bukkit.inventory.InventoryHolder;
// CraftBukkit end
public class InventoryCraftResult implements IInventory {
private ItemStack[] items = new ItemStack[1];
// CraftBukkit start
public ItemStack[] getContents() {
return this.items;
}
public 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 List<HumanEntity> getViewers() {
return new ArrayList<HumanEntity>();
}
// CraftBukkit end
public InventoryCraftResult() {}
public int getSize() {
return 1;
}
public ItemStack getItem(int i) {
return this.items[i];
}
public String getName() {
return "Result";
}
public ItemStack splitStack(int i, int j) {
if (this.items[i] != null) {
ItemStack itemstack = this.items[i];
this.items[i] = null;
return itemstack;
} else {
return null;
}
}
public ItemStack splitWithoutUpdate(int i) {
if (this.items[i] != null) {
ItemStack itemstack = this.items[i];
this.items[i] = null;
return itemstack;
} else {
return null;
}
}
public void setItem(int i, ItemStack itemstack) {
this.items[i] = itemstack;
}
public int getMaxStackSize() {
return 64;
}
public void update() {}
public boolean a(EntityHuman entityhuman) {
return true;
}
public void f() {}
public void g() {}
}
|