Pump.java 文件源码

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

项目:StarQuestCode 作者:
/**
 * Adds a drain block to the furnace's smelt slot for the deconstruction of
 * a drain.
 * 
 * @param data The data value of the tube material to check.
 * @return True if a drain block item could be added to the furnace smelt
 *         slot.
 */
boolean putDrainItem(byte data) {
    FurnaceInventory inventory = ((Furnace) anchor.getRelative(backward).getBlock().getState()).getInventory();
    ItemStack item = inventory.getSmelting();
    if (item == null) {
        inventory.setSmelting(new ItemStack(tubeMaterial, 1, data));
        return true;
    } else if (item.getType() == tubeMaterial && item.getDurability() == data) {
        int amount = item.getAmount();
        if (amount < tubeMaterial.getMaxStackSize()) {
            item.setAmount(amount + 1);
            inventory.setSmelting(item);
            return true;
        }
    }
    return false;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号