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);
}
}
}
Aggregations