Search in sources :

Example 1 with IMultiblockLogicAlveary

use of forestry.api.multiblock.IMultiblockLogicAlveary in project Binnie by ForestryMC.

the class AlvearyLogicFrameHousing method wearOutEquipment.

@Override
public void wearOutEquipment(final int amount) {
    IHiveFrame hiveFrame = this.getHiveFrame();
    if (hiveFrame != null) {
        IBeeRoot beeRoot = Utils.getBeeRoot();
        IMultiblockLogicAlveary multiblockLogic = tile.getMultiblockLogic();
        IAlvearyController alvearyController = multiblockLogic.getController();
        ItemStack queenStack = alvearyController.getBeeInventory().getQueen();
        IBee queen = beeRoot.getMember(queenStack);
        if (queen != null) {
            final int wear = Math.round(amount * 5 * beeRoot.getBeekeepingMode(tile.getWorldObj()).getWearModifier());
            ItemStack frame = inv.getStackInSlot(0);
            ItemStack frameUsed = hiveFrame.frameUsed(alvearyController, frame, queen, wear);
            inv.setStackInSlot(0, frameUsed);
        }
    }
}
Also used : IHiveFrame(forestry.api.apiculture.IHiveFrame) IAlvearyController(forestry.api.multiblock.IAlvearyController) IMultiblockLogicAlveary(forestry.api.multiblock.IMultiblockLogicAlveary) IBeeRoot(forestry.api.apiculture.IBeeRoot) IBee(forestry.api.apiculture.IBee) ItemStack(net.minecraft.item.ItemStack)

Aggregations

IBee (forestry.api.apiculture.IBee)1 IBeeRoot (forestry.api.apiculture.IBeeRoot)1 IHiveFrame (forestry.api.apiculture.IHiveFrame)1 IAlvearyController (forestry.api.multiblock.IAlvearyController)1 IMultiblockLogicAlveary (forestry.api.multiblock.IMultiblockLogicAlveary)1 ItemStack (net.minecraft.item.ItemStack)1