You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
whilenottmp_result.item:is_empty() andtmp_result.item:get_name() ==expected_type_nameand(no_stack_limitornb_res+tmp_result.item:get_count() <=room_left) do
@@ -90,24 +88,26 @@ local function craft_organize(player, formname, fields)
90
88
ifnottype_namethenreturnend-- craft is empty
91
89
ifnotonly_one_typethenminetest.chat_send_player(player_name, "You can only organize one type of item.") returnend
92
90
93
-
-- Don't exceed 9*99 for non creative players (it shouldn't but who knows ...)
91
+
-- Don't exceed 9*99 for non creative players. It shouldn't happen but avoids potential losses then
94
92
localtotal_amount=get_total_amount(craft_list)
95
93
ifnotis_creativeandtotal_amount>891thenminetest.chat_send_player(player_name, "There are too many items to organize ! Have less than 9 x 99 items.") returnend
elseifv:is_empty() thenroom_left=room_left+item:get_stack_max() end
11
+
end
12
+
returnroom_left
13
+
end
14
+
15
+
16
+
17
+
-- Add items to the inventory, splitting in stacks if necessary
18
+
-- Have to separate item_name & nb_items instead of using an Itemstack in the case you want to add many not stackable ItemStack (keys, filled buckets...)
0 commit comments