Skip to content

Commit

Permalink
[furnace.lua] Won't use non-fuel items as fuel anymore.
Browse files Browse the repository at this point in the history
  • Loading branch information
Unarelith committed Mar 1, 2020
1 parent 1c21f89 commit 86125bf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/source/gui/InventoryWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ bool InventoryWidget::receiveItemStack(const ItemWidget *itemStack, AbstractInve

if (stackAdded)
sendUpdatePacket();
else
else if (src == this)
m_inventory->setStack(itemStack->x(), itemStack->y(), stack.item().stringID(), stack.amount());

return stackAdded;
Expand Down
1 change: 1 addition & 0 deletions mods/default/furnace.lua
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ mod:block {
end

if ticks_remaining == 0 and recipe and fuel_stack:amount() > 0 and
fuel_stack:item():is_fuel() and
(output_stack:item():id() == 0 or output_stack:amount() == 0
or output_stack:item():id() == recipe:result():item():id()) then
data.inventory:set_stack(2, 0, fuel_stack:item():stringID(), fuel_stack:amount() - 1)
Expand Down
3 changes: 2 additions & 1 deletion server/source/lua/ScriptEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ void ScriptEngine::initUsertypes() {
m_lua.new_usertype<Item>("Item",
"id", &Item::id,
"stringID", &Item::stringID,
"burn_time", &Item::burnTime
"burn_time", &Item::burnTime,
"is_fuel", &Item::isFuel
);

m_lua.new_usertype<glm::ivec3>("ivec3",
Expand Down

0 comments on commit 86125bf

Please sign in to comment.