FurnaceEndpoint.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:StarQuestCode 作者:
/**
 * Handles a sending inventory for the furnace at the given location. Does
 * not check if the location has a valid furnace.<br>
 * Fuels: Added to the fuel slot if there is room.<br>
 * Items that can be burnt: Added to the burn slot.
 * 
 * @param location
 * @param inventory
 * @return True if the inventory was changed.
 */
public boolean handle(Inventory inventory) {
    FurnaceInventory furnaceInventory = ((Furnace) location.getBlock().getState()).getInventory();
    if (furnaceInventory == inventory) {
        return false;
    }
    updateLevels();

    if (fuelAmount < 2) {
        if (restockFuel(furnaceInventory, inventory))
            return true;
        return restockSmelting(furnaceInventory, inventory);
    } else {
        if (restockSmelting(furnaceInventory, inventory))
            return true;
        return restockFuel(furnaceInventory, inventory);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号