/* 107: */ /* 108: */ public static boolean saveToSpawner(int x, int y, int z, EntityHumanBase human) /* 109: */ { /* 110:101 */ World world = human.worldObj; /* 111:102 */ if (world.getBlock(x, y, z) != Blocks.air) { /* 112:103 */ y++; /* 113: */ } /* 114:105 */ world.setBlock(x, y, z, ChocolateQuest.spawner); /* 115:106 */ BlockMobSpawnerTileEntity te = new BlockMobSpawnerTileEntity(); /* 116:107 */ NBTTagCompound tag = new NBTTagCompound(); /* 117:108 */ human.writeToNBTOptional(tag); /* 118:109 */ human.writeEntityToSpawnerNBT(tag, x, y, z); /* 119:110 */ te.mobNBT = tag; /* 120:111 */ te.mob = -1; /* 121:112 */ world.setTileEntity(x, y, z, te); /* 122:113 */ return true; /* 123: */ }
/* 87: */ /* 88: */ public boolean saveEntityToSpawner(int x, int y, int z, Entity entity) /* 89: */ { /* 90: 83 */ World world = entity.worldObj; /* 91: 84 */ if (world.getBlock(x, y, z) != Blocks.air) { /* 92: 85 */ y++; /* 93: */ } /* 94: 87 */ world.setBlock(x, y, z, ChocolateQuest.spawner); /* 95: 88 */ BlockMobSpawnerTileEntity te = new BlockMobSpawnerTileEntity(); /* 96: 89 */ NBTTagCompound tag = new NBTTagCompound(); /* 97: 90 */ boolean wrote = entity.writeToNBTOptional(tag); /* 98: 91 */ if (wrote) /* 99: */ { /* 100: 92 */ te.mobNBT = tag; /* 101: 93 */ te.mob = -1; /* 102: 94 */ world.setTileEntity(x, y, z, te); /* 103: 95 */ return true; /* 104: */ } /* 105: 97 */ return false; /* 106: */ }
/* 124: */ /* 125: */ public boolean onItemUse( ItemStack is, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) /* 126: */ { /* 127:118 */ if (!world.isRemote) /* 128: */ { /* 129:119 */ TileEntity te = world.getTileEntity(x, y, z); /* 130:120 */ if ((te instanceof BlockMobSpawnerTileEntity)) /* 131: */ { /* 132:121 */ BlockMobSpawnerTileEntity teSpawner = (BlockMobSpawnerTileEntity) te; /* 133:122 */ teSpawner.spawnEntity(); /* 134: */ } /* 135: */ } /* 136:141 */ return super.onItemUse(is, player, world, x, y, z, par7, par8, par9, par10); /* 137: */ }