Search in sources :

Example 1 with IAlvearyComponent

use of forestry.api.multiblock.IAlvearyComponent in project ForestryMC by ForestryMC.

the class AlvearyController method onBlockRemoved.

@Override
protected void onBlockRemoved(IMultiblockComponent oldPart) {
    if (oldPart instanceof IAlvearyComponent) {
        if (oldPart instanceof IAlvearyComponent.BeeModifier) {
            IAlvearyComponent.BeeModifier alvearyBeeModifier = (IAlvearyComponent.BeeModifier) oldPart;
            IBeeModifier beeModifier = alvearyBeeModifier.getBeeModifier();
            beeModifiers.remove(beeModifier);
        }
        if (oldPart instanceof IAlvearyComponent.BeeListener) {
            IAlvearyComponent.BeeListener beeListenerSource = (IAlvearyComponent.BeeListener) oldPart;
            IBeeListener beeListener = beeListenerSource.getBeeListener();
            beeListeners.remove(beeListener);
        }
        if (oldPart instanceof IAlvearyComponent.Climatiser) {
            climatisers.remove(oldPart);
        }
        if (oldPart instanceof IAlvearyComponent.Active) {
            activeComponents.remove(oldPart);
        }
    }
}
Also used : AlvearyBeeModifier(forestry.apiculture.AlvearyBeeModifier) IBeeModifier(forestry.api.apiculture.IBeeModifier) IBeeListener(forestry.api.apiculture.IBeeListener) IBeeModifier(forestry.api.apiculture.IBeeModifier) IBeeListener(forestry.api.apiculture.IBeeListener) IAlvearyComponent(forestry.api.multiblock.IAlvearyComponent)

Example 2 with IAlvearyComponent

use of forestry.api.multiblock.IAlvearyComponent in project ForestryMC by ForestryMC.

the class AlvearyController method onBlockAdded.

@Override
protected void onBlockAdded(IMultiblockComponent newPart) {
    if (newPart instanceof IAlvearyComponent) {
        if (newPart instanceof IAlvearyComponent.BeeModifier) {
            IAlvearyComponent.BeeModifier alvearyBeeModifier = (IAlvearyComponent.BeeModifier) newPart;
            IBeeModifier beeModifier = alvearyBeeModifier.getBeeModifier();
            beeModifiers.add(beeModifier);
        }
        if (newPart instanceof IAlvearyComponent.BeeListener) {
            IAlvearyComponent.BeeListener beeListenerSource = (IAlvearyComponent.BeeListener) newPart;
            IBeeListener beeListener = beeListenerSource.getBeeListener();
            beeListeners.add(beeListener);
        }
        if (newPart instanceof IAlvearyComponent.Climatiser) {
            climatisers.add((IAlvearyComponent.Climatiser) newPart);
        }
        if (newPart instanceof IAlvearyComponent.Active) {
            activeComponents.add((IAlvearyComponent.Active) newPart);
        }
    }
}
Also used : AlvearyBeeModifier(forestry.apiculture.AlvearyBeeModifier) IBeeModifier(forestry.api.apiculture.IBeeModifier) IBeeListener(forestry.api.apiculture.IBeeListener) IBeeModifier(forestry.api.apiculture.IBeeModifier) IBeeListener(forestry.api.apiculture.IBeeListener) IAlvearyComponent(forestry.api.multiblock.IAlvearyComponent)

Aggregations

IBeeListener (forestry.api.apiculture.IBeeListener)2 IBeeModifier (forestry.api.apiculture.IBeeModifier)2 IAlvearyComponent (forestry.api.multiblock.IAlvearyComponent)2 AlvearyBeeModifier (forestry.apiculture.AlvearyBeeModifier)2