Code: Select all
if player.cursor_stack ~= nil then
game.player.print(player.cursor_stack.name)
else
return
end
Code: Select all
if player.cursor_stack ~= nil then
game.player.print(player.cursor_stack.name)
else
return
end
if player.cursor_stack.valid_for_read then ...Changed LuaEntity::stack, LuaEntity::held_stack and LuaPlayer::cursor_stack to return LuaItemStack objects.
Changed LuaItemStack to allow reading any inventory slot even when the item in the slot is invalid. LuaItemStack::valid_for_read should be used before accessing the normal properties/methods for a given LuaItemStack.