Skip to content

Commit

Permalink
add 'inventory.input' for furnace+brewing stands, for #2046
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Nov 24, 2019
1 parent b0f335c commit 046cddb
Showing 1 changed file with 9 additions and 5 deletions.
Expand Up @@ -789,10 +789,13 @@ public ItemTag getFuel() {
return null;
}

public ItemTag getSmelting() {
public ItemTag getInput() {
if (inventory instanceof FurnaceInventory) {
return new ItemTag(((FurnaceInventory) inventory).getSmelting());
}
if (inventory instanceof BrewerInventory) {
return new ItemTag(((BrewerInventory) inventory).getIngredient());
}
return null;
}

Expand Down Expand Up @@ -2357,19 +2360,20 @@ else if ((object.inventory instanceof FurnaceInventory)) {
});

// <--[tag]
// @attribute <InventoryTag.smelting>
// @attribute <InventoryTag.input>
// @returns ItemTag
// @mechanism smelting
// @description
// Returns the item currently in the smelting section of a furnace inventory.
// Returns the item currently in the smelting slot of a furnace inventory, or the ingredient slot of a brewing stand inventory.
// -->
registerTag("smelting", (attribute, object) -> {
ItemTag smelting = object.getSmelting();
registerTag("input", (attribute, object) -> {
ItemTag smelting = object.getInput();
if (smelting == null) {
return null;
}
return smelting;
});
registerTag("smelting", tagProcessor.registeredObjectTags.get("input"));

// <--[tag]
// @attribute <InventoryTag.type>
Expand Down

0 comments on commit 046cddb

Please sign in to comment.