Differences From
Artifact [963193f502]:
195 195 end
196 196
197 197 a.suit[name] = img
198 198 end
199 199 end
200 200 end
201 201
202 - minetest.register_tool(id, {
202 + core.register_tool(id, {
203 203 short_description = def.name;
204 204 description = starlit.ui.tooltip {
205 205 title = def.name;
206 206 desc = def.desc;
207 207 color = lib.color(.1, .7, 1);
208 208 };
209 209 groups = {
................................................................................
313 313 };
314 314 starlit_suit_canisters = {
315 315 suitSlot = true;
316 316 itemClass = 'canister';
317 317 };
318 318 }
319 319
320 -minetest.register_allow_player_inventory_action(function(luser, act, inv, p)
320 +core.register_allow_player_inventory_action(function(luser, act, inv, p)
321 321 local user = starlit.activeUsers[luser:get_player_name()]
322 322 local function grp(i,g)
323 - return minetest.get_item_group(i:get_name(), g) ~= 0
323 + return core.get_item_group(i:get_name(), g) ~= 0
324 324 end
325 325 local function checkBaseRestrictions(list)
326 326 local restrictions = slotProps[list]
327 327 if not restrictions then return nil, true end
328 328 if restrictions.suitSlot then
329 329 if user:naked() then return restrictions, false end
330 330 end
................................................................................
350 350 return true
351 351 end
352 352 local function itemCanLeave(item, list)
353 353 local rst, ok = checkBaseRestrictions(list)
354 354 if not ok then return false end
355 355 if rst == nil then return true end
356 356
357 - if minetest.get_item_group(item:get_name(), 'specialInventory') then
357 + if core.get_item_group(item:get_name(), 'specialInventory') then
358 358
359 359 end
360 360
361 361 if rst.maintenanceNode then return false end
362 362 return true
363 363 end
364 364
................................................................................
371 371 if not itemFits(p.stack, p.listname) then return 0 end
372 372 elseif act == 'take' then
373 373 if not itemCanLeave(p.stack, p.listname) then return 0 end
374 374 end
375 375 return true
376 376 end)
377 377
378 -minetest.register_on_player_inventory_action(function(luser, act, inv, p)
378 +core.register_on_player_inventory_action(function(luser, act, inv, p)
379 379 local user = starlit.activeUsers[luser:get_player_name()]
380 380 local function slotChange(slot,a,item)
381 381 local s = slotProps[slot]
382 382 if slot == 'starlit_suit' then
383 383 user:updateSuit()
384 384 if user:naked() then
385 385 starlit.type.suit.purgeInventories(user.entity)