src/main/java/org/cyclops/integrateddynamics/core/helper/PartHelpers.java
public static boolean removePart(World world, BlockPos pos, EnumFacing side, @Nullable EntityPlayer player,
                                     boolean destroyIfEmpty, boolean dropMainElement, boolean saveState) {
        IPartContainer partContainer = getPartContainer(world, pos, side);
        ICableFakeable cableFakeable = CableHelpers.getCableFakeable(world, pos, side);
        partContainer.removePart(side, player, dropMainElement, saveState);

        // Remove full cable block if this was the last part and if it was already an unreal cable.
        boolean removeCompletely = destroyIfEmpty && (cableFakeable == null || !cableFakeable.isRealCable()) && !partContainer.hasParts();
        if(removeCompletely) {
            world.setBlockState(pos, Blocks.AIR.getDefaultState(), 3);
        } else {
            world.notifyNeighborsOfStateChange(pos, world.getBlockState(pos).getBlock(), true);
            // If there is a cable in the direction of the removed part, try connecting with it.
            if (CableHelpers.getCable(world, pos.offset(side), side.getOpposite()) != null) {
                CableHelpers.updateConnections(world, pos, side);
                CableHelpers.updateConnections(world, pos.offset(side), side.getOpposite());
                NetworkHelpers.initNetwork(world, pos, side);
            }
        }

        return !removeCompletely;
    }
/**
     * Remove a part from the given side of the given part container.
     * @param world The world.
     * @param pos The position of the container.
     * @param side The side.
     * @param player The player that is removing the part or null.
     * @param destroyIfEmpty If the cable block must be removed if no other parts are present after this removal.
     * @param dropMainElement If the main part element should be dropped.
     * @param saveState If the element state should be saved in the item.
     * @return If the block was set to air (removed).
     */
Remove a part from the given side of the given part container.
@param world The world.
@param pos The position of the container.
@param side The side.
@param player The player that is removing the part or null.
@param destroyIfEmpty If the cable block must be removed if no other parts are present after this removal.
@param dropMainElement If the main part element should be dropped.
@param saveState If the element state should be saved in the item.
@return If the block was set to air (removed).
Remove a part from the given side of the given part container . @param world The world . @param pos The position of the container . @param side The side . @param player The player that is removing the part or null . @param destroyIfEmpty If the cable block must be removed if no other parts are present after this removal . @param dropMainElement If the main part element should be dropped . @param saveState If the element state should be saved in the item . @return If the block was set to air ( removed ) .
public static boolean removePart(World world, BlockPos pos, EnumFacing side, @Nullable EntityPlayer player,
                                     boolean destroyIfEmpty, boolean dropMainElement, boolean saveState) {
        IPartContainer partContainer = getPartContainer(world, pos, side);
        ICableFakeable cableFakeable = CableHelpers.getCableFakeable(world, pos, side);
        partContainer.removePart(side, player, dropMainElement, saveState);
        boolean removeCompletely = destroyIfEmpty && (cableFakeable == null || !cableFakeable.isRealCable()) && !partContainer.hasParts();
        if(removeCompletely) {
            world.setBlockState(pos, Blocks.AIR.getDefaultState(), 3);
        } else {
            world.notifyNeighborsOfStateChange(pos, world.getBlockState(pos).getBlock(), true);
            if (CableHelpers.getCable(world, pos.offset(side), side.getOpposite()) != null) {
                CableHelpers.updateConnections(world, pos, side);
                CableHelpers.updateConnections(world, pos.offset(side), side.getOpposite());
                NetworkHelpers.initNetwork(world, pos, side);
            }
        }
        return !removeCompletely;
    }
public static boolean removePart ( World world , BlockPos pos , EnumFacing side , @ Nullable EntityPlayer player , boolean destroyIfEmpty , boolean dropMainElement , boolean saveState ) { IPartContainer partContainer = getPartContainer ( world , pos , side ) ; ICableFakeable cableFakeable = CableHelpers . getCableFakeable ( world , pos , side ) ; partContainer . removePart ( side , player , dropMainElement , saveState ) ; boolean removeCompletely = destroyIfEmpty && ( cableFakeable == null || ! cableFakeable . isRealCable ( ) ) && ! partContainer . hasParts ( ) ; if ( removeCompletely ) { world . setBlockState ( pos , Blocks . AIR . getDefaultState ( ) , 3 ) ; } else { world . notifyNeighborsOfStateChange ( pos , world . getBlockState ( pos ) . getBlock ( ) , true ) ; if ( CableHelpers . getCable ( world , pos . offset ( side ) , side . getOpposite ( ) ) != null ) { CableHelpers . updateConnections ( world , pos , side ) ; CableHelpers . updateConnections ( world , pos . offset ( side ) , side . getOpposite ( ) ) ; NetworkHelpers . initNetwork ( world , pos , side ) ; } } return ! removeCompletely ; }
Remove a part from the given side of the given part container.
Remove a part from the given side of the given part container .
// Remove full cable block if this was the last part and if it was already an unreal cable. // If there is a cable in the direction of the removed part, try connecting with it.