/** Called when the block is broken. */ @Override public void breakBlock( final World world, final int x, final int y, final int z, final Block block, final int metaData) { // Is this server side? if (EffectiveSide.isServerSide()) { // Get the tile TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof TileKnowledgeInscriber) { TileKnowledgeInscriber tileKI = (TileKnowledgeInscriber) tile; // Does the inscriber have a cell? if (tileKI.hasKCore()) { // Spawn the core as an item entity. world.spawnEntityInWorld( new EntityItem( world, 0.5 + x, 0.5 + y, 0.2 + z, tileKI.getInventory().getStackInSlot(TileKnowledgeInscriber.KCORE_SLOT))); } } } // Call super super.breakBlock(world, x, y, z, block, metaData); }
/** Set's the aspect we are filtering */ @Override public void setAspect(final int index, final Aspect aspect, final EntityPlayer player) { // Set the filtered aspect this.filterAspect = aspect; // Are we client side? if (EffectiveSide.isClientSide()) { return; } this.checkRegistration(); // Check network amount this.onListUpdate(); // Send the aspect to the client List<Aspect> filter = new ArrayList<Aspect>(); filter.add(aspect); new PacketClientAspectSlot().createFilterListUpdate(filter, player).sendPacketToPlayer(); }