Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
1package net.minecraft.server;
2
3public class SlotResult extends Slot {
4
5 private final IInventory d;
6 private EntityHuman e;
7
8 public SlotResult(EntityHuman entityhuman, IInventory iinventory, IInventory iinventory1, int i, int j, int k) {
9 super(iinventory1, i, j, k);
10 this.e = entityhuman;
11 this.d = iinventory;
12 }
13
14 public boolean isAllowed(ItemStack itemstack) {
15 return false;
16 }
17
18 public void a(ItemStack itemstack) {
19 itemstack.b(this.e.world, this.e);
20 if (itemstack.id == Block.WORKBENCH.id) {
21 this.e.a(AchievementList.h, 1);
22 } else if (itemstack.id == Item.WOOD_PICKAXE.id) {
23 this.e.a(AchievementList.i, 1);
24 } else if (itemstack.id == Block.FURNACE.id) {
25 this.e.a(AchievementList.j, 1);
26 } else if (itemstack.id == Item.WOOD_HOE.id) {
27 this.e.a(AchievementList.l, 1);
28 } else if (itemstack.id == Item.BREAD.id) {
29 this.e.a(AchievementList.m, 1);
30 } else if (itemstack.id == Item.CAKE.id) {
31 this.e.a(AchievementList.n, 1);
32 } else if (itemstack.id == Item.STONE_PICKAXE.id) {
33 this.e.a(AchievementList.o, 1);
34 } else if (itemstack.id == Item.WOOD_SWORD.id) {
35 this.e.a(AchievementList.r, 1);
36 }
37
38 for (int i = 0; i < this.d.getSize(); ++i) {
39 ItemStack itemstack1 = this.d.getItem(i);
40
41 if (itemstack1 != null) {
42 this.d.splitStack(i, 1);
43 if (itemstack1.getItem().i()) {
44 this.d.setItem(i, new ItemStack(itemstack1.getItem().h()));
45 }
46 }
47 }
48 }
49}