Use new Minetest settings API syntax for most mods
This commit is contained in:
parent
6fa426741e
commit
e5a34367c9
41 changed files with 86 additions and 86 deletions
|
@ -118,12 +118,12 @@ local dispenserdef = {
|
|||
-- Ignite air or fire
|
||||
if dropnode.name == "air" then
|
||||
minetest.add_node(droppos, {name="mcl_fire:fire"})
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
stack:add_wear(65535/65) -- 65 uses
|
||||
end
|
||||
elseif dropnode.name == "mcl_tnt:tnt" then
|
||||
tnt.ignite(droppos)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
stack:add_wear(65535/65) -- 65 uses
|
||||
end
|
||||
end
|
||||
|
|
|
@ -103,7 +103,7 @@ end
|
|||
|
||||
local on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
||||
-- Only allow access in Creative Mode
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -179,7 +179,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||
if index ~= nil and x ~= nil and y ~= nil and z ~= nil then
|
||||
local pos = {x=tonumber(x), y=tonumber(y), z=tonumber(z)}
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
minetest.chat_send_player(player:get_player_name(), "Editing the command block has failed! You can only change the command block in Creative Mode!")
|
||||
return
|
||||
end
|
||||
|
|
|
@ -77,7 +77,7 @@ end
|
|||
|
||||
local drop_item = function(pos, node, meta)
|
||||
if meta:get_string("item") ~= "" then
|
||||
if node.name == "itemframes:frame" and not minetest.setting_getbool("creative_mode") then
|
||||
if node.name == "itemframes:frame" and not minetest.settings:get_bool("creative_mode") then
|
||||
local item = ItemStack(minetest.deserialize(meta:get_string("itemdata")))
|
||||
minetest.add_item(pos, item)
|
||||
end
|
||||
|
@ -120,7 +120,7 @@ minetest.register_node("itemframes:frame",{
|
|||
-- itemdata holds the serialized itemstack in table form
|
||||
meta:set_string("itemdata", itemdata)
|
||||
update_item(pos,node)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
end
|
||||
|
|
|
@ -24,12 +24,12 @@ end
|
|||
|
||||
local beddesc = "Beds allow you to sleep at night and waste some time. Survival in this world does not demand sleep, but sleeping might have some other uses. "
|
||||
local beduse = "Right-click on the bed to try to sleep in it. This only works when the sun sets or at night."
|
||||
if minetest.setting_getbool("enable_bed_respawn") == false then
|
||||
if minetest.settings:get_bool("enable_bed_respawn") == false then
|
||||
beddesc = beddesc .. "In local folklore, legends are told of other worlds where setting the start point for your next would be possible. But this world is not one of them. "
|
||||
else
|
||||
beddesc = beddesc .. "By sleeping in a bed, you set the starting point for your next life. "
|
||||
end
|
||||
if minetest.setting_getbool("enable_bed_night_skip") == false then
|
||||
if minetest.settings:get_bool("enable_bed_night_skip") == false then
|
||||
beddesc = beddesc .. "In this strange world, the time will not pass faster for you when you sleep."
|
||||
else
|
||||
beddesc = beddesc .. "Going into bed seems to make time pass faster: The night will be skipped when you go sleep and you're alone in this world. If you're not alone, the night is skipped when all players in this world went to sleep."
|
||||
|
@ -118,7 +118,7 @@ function mcl_beds.register_bed(name, def)
|
|||
minetest.set_node(pos, {name = name .. "_bottom", param2 = dir})
|
||||
minetest.set_node(botpos, {name = name .. "_top", param2 = dir})
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
local pi = math.pi
|
||||
local player_in_bed = 0
|
||||
local is_sp = minetest.is_singleplayer()
|
||||
local enable_respawn = minetest.setting_getbool("enable_bed_respawn")
|
||||
local enable_respawn = minetest.settings:get_bool("enable_bed_respawn")
|
||||
if enable_respawn == nil then
|
||||
enable_respawn = true
|
||||
end
|
||||
|
@ -22,7 +22,7 @@ local function get_look_yaw(pos)
|
|||
end
|
||||
|
||||
local function is_night_skip_enabled()
|
||||
local enable_night_skip = minetest.setting_getbool("enable_bed_night_skip")
|
||||
local enable_night_skip = minetest.settings:get_bool("enable_bed_night_skip")
|
||||
if enable_night_skip == nil then
|
||||
enable_night_skip = true
|
||||
end
|
||||
|
|
|
@ -77,7 +77,7 @@ function mcl_buckets.register_liquid(source, flowing, itemname, inventory_image,
|
|||
|
||||
local place_liquid = function(pos, node, source, flowing, fullness)
|
||||
sound_place(source, pos)
|
||||
if math.floor(fullness/128) == 1 or (not minetest.setting_getbool("liquid_finite")) then
|
||||
if math.floor(fullness/128) == 1 or (not minetest.settings:get_bool("liquid_finite")) then
|
||||
minetest.add_node(pos, {name=source, param2=fullness})
|
||||
return
|
||||
elseif node.name == flowing then
|
||||
|
@ -138,7 +138,7 @@ function mcl_buckets.register_liquid(source, flowing, itemname, inventory_image,
|
|||
end
|
||||
|
||||
-- Handle bucket item and inventory stuff
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
-- Add empty bucket and put it into inventory, if possible.
|
||||
-- Drop empty bucket otherwise.
|
||||
local new_bucket = ItemStack("mcl_buckets:bucket_empty")
|
||||
|
@ -189,10 +189,10 @@ minetest.register_craftitem("mcl_buckets:bucket_empty", {
|
|||
liquiddef = mcl_buckets.liquids[nn]
|
||||
local new_bucket
|
||||
if liquiddef ~= nil and liquiddef.itemname ~= nil and (nn == liquiddef.source or
|
||||
(nn == liquiddef.flowing and minetest.setting_getbool("liquid_finite"))) then
|
||||
(nn == liquiddef.flowing and minetest.settings:get_bool("liquid_finite"))) then
|
||||
|
||||
-- Fill bucket, but not in Creative Mode
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
new_bucket = ItemStack({name = liquiddef.itemname, metadata = tostring(node.param2)})
|
||||
end
|
||||
|
||||
|
@ -206,7 +206,7 @@ minetest.register_craftitem("mcl_buckets:bucket_empty", {
|
|||
elseif nn == "mcl_cauldrons:cauldron_3" then
|
||||
-- Take water out of full cauldron
|
||||
minetest.set_node(pointed_thing.under, {name="mcl_cauldrons:cauldron"})
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
new_bucket = ItemStack("mcl_buckets:bucket_water")
|
||||
end
|
||||
sound_take("mcl_core:water_source", pointed_thing.under)
|
||||
|
@ -224,7 +224,7 @@ minetest.register_craftitem("mcl_buckets:bucket_empty", {
|
|||
else
|
||||
minetest.add_item(user:getpos(), new_bucket)
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
|
|
|
@ -629,7 +629,7 @@ for color, desc in pairs(boxtypes) do
|
|||
local iinv_main = minetest.deserialize(imeta)
|
||||
ninv:set_list("main", iinv_main)
|
||||
ninv:set_size("main", 9*3)
|
||||
if minetest.setting_getbool("creative_mode") then
|
||||
if minetest.settings:get_bool("creative_mode") then
|
||||
if not ninv:is_empty("main") then
|
||||
return nil
|
||||
else
|
||||
|
@ -651,7 +651,7 @@ for color, desc in pairs(boxtypes) do
|
|||
local boxitem = ItemStack("mcl_chests:"..color.."_shulker_box")
|
||||
boxitem:set_metadata(data)
|
||||
|
||||
if minetest.setting_getbool("creative_mode") then
|
||||
if minetest.settings:get_bool("creative_mode") then
|
||||
if not inv:is_empty("main") then
|
||||
minetest.add_item(pos, boxitem)
|
||||
end
|
||||
|
|
|
@ -43,7 +43,7 @@ function mcl_cocoas.place(itemstack, placer, pointed_thing, plantname)
|
|||
|
||||
minetest.sound_play("default_place_node", {pos = pt.above, gain = 1.0})
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
mcl_compass = {}
|
||||
|
||||
local default_spawn_settings = minetest.setting_get("static_spawnpoint")
|
||||
local default_spawn_settings = minetest.settings:get("static_spawnpoint")
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
local players = minetest.get_connected_players()
|
||||
|
@ -15,7 +15,7 @@ minetest.register_globalstep(function(dtime)
|
|||
end
|
||||
if has_compass(player) then
|
||||
local spawn = {x=0,y=0,z=0}
|
||||
local s = minetest.setting_get("static_spawnpoint")
|
||||
local s = minetest.settings:get("static_spawnpoint")
|
||||
if s then
|
||||
local numbers = string.split(s, ",")
|
||||
spawn.x = tonumber(numbers[1])
|
||||
|
|
|
@ -200,7 +200,7 @@ minetest.register_on_dignode(function(pos, node)
|
|||
local np={x=pos.x, y=pos.y+1, z=pos.z}
|
||||
while minetest.get_node(np).name==timber_nodenames[i] do
|
||||
minetest.remove_node(np)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
minetest.add_item(np, timber_nodenames[i])
|
||||
end
|
||||
np={x=np.x, y=np.y+1, z=np.z}
|
||||
|
|
|
@ -135,7 +135,7 @@ function mcl_doors:register_door(name, def)
|
|||
meta = minetest.get_meta(pt2)
|
||||
meta:set_int("is_open", 0)
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
|
|
|
@ -282,7 +282,7 @@ minetest.register_craftitem("mcl_dye:white", {
|
|||
end
|
||||
|
||||
-- Use the bone meal on the ground
|
||||
if(mcl_dye.apply_bone_meal(pointed_thing) and not minetest.setting_getbool("creative_mode")) then
|
||||
if(mcl_dye.apply_bone_meal(pointed_thing) and not minetest.settings:get_bool("creative_mode")) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
|
|
|
@ -42,7 +42,7 @@ minetest.register_tool("mcl_farming:hoe_wood", {
|
|||
end
|
||||
|
||||
if create_soil(pointed_thing.under, user:get_inventory()) then
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:add_wear(65535/60)
|
||||
end
|
||||
return itemstack
|
||||
|
@ -92,7 +92,7 @@ minetest.register_tool("mcl_farming:hoe_stone", {
|
|||
end
|
||||
|
||||
if create_soil(pointed_thing.under, user:get_inventory()) then
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:add_wear(65535/132)
|
||||
end
|
||||
return itemstack
|
||||
|
@ -137,7 +137,7 @@ minetest.register_tool("mcl_farming:hoe_iron", {
|
|||
end
|
||||
|
||||
if create_soil(pointed_thing.under, user:get_inventory()) then
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:add_wear(65535/251)
|
||||
end
|
||||
return itemstack
|
||||
|
@ -190,7 +190,7 @@ minetest.register_tool("mcl_farming:hoe_gold", {
|
|||
end
|
||||
|
||||
if create_soil(pointed_thing.under, user:get_inventory()) then
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:add_wear(65535/33)
|
||||
end
|
||||
return itemstack
|
||||
|
@ -244,7 +244,7 @@ minetest.register_tool("mcl_farming:hoe_diamond", {
|
|||
end
|
||||
|
||||
if create_soil(pointed_thing.under, user:get_inventory()) then
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:add_wear(65535/1562)
|
||||
end
|
||||
return itemstack
|
||||
|
|
|
@ -89,7 +89,7 @@ function mcl_farming:place_seed(itemstack, placer, pointed_thing, plantname)
|
|||
return
|
||||
end
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
|
|
|
@ -18,12 +18,12 @@ minetest.register_craftitem("mcl_fire:fire_charge", {
|
|||
if pointed_thing.type == "node" then
|
||||
if minetest.get_node(pointed_thing.under).name == "mcl_tnt:tnt" then
|
||||
tnt.ignite(pointed_thing.under)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
else
|
||||
mcl_fire.set_fire(pointed_thing)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
end
|
||||
|
|
|
@ -34,7 +34,7 @@ minetest.register_tool("mcl_fire:flint_and_steel", {
|
|||
if itemstack:get_count() == 0 and idef.sound and idef.sound.breaks then
|
||||
minetest.sound_play(idef.sound.breaks, {pos=user:getpos(), gain=0.5})
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") and used == true then
|
||||
if not minetest.settings:get_bool("creative_mode") and used == true then
|
||||
itemstack:add_wear(65535/65) -- 65 uses
|
||||
end
|
||||
return itemstack
|
||||
|
|
|
@ -156,7 +156,7 @@ minetest.override_item("mcl_core:lava_source", {
|
|||
-- Sound
|
||||
--
|
||||
|
||||
local flame_sound = minetest.setting_getbool("flame_sound")
|
||||
local flame_sound = minetest.settings:get_bool("flame_sound")
|
||||
if flame_sound == nil then
|
||||
-- Enable if no setting present
|
||||
flame_sound = true
|
||||
|
@ -292,11 +292,11 @@ minetest.register_abm({
|
|||
|
||||
-- Enable the following ABMs according to 'enable fire' setting
|
||||
|
||||
local fire_enabled = minetest.setting_getbool("enable_fire")
|
||||
local fire_enabled = minetest.settings:get_bool("enable_fire")
|
||||
if fire_enabled == nil then
|
||||
-- New setting not specified, check for old setting.
|
||||
-- If old setting is also not specified, 'not nil' is true.
|
||||
fire_enabled = not minetest.setting_getbool("disable_fire")
|
||||
fire_enabled = not minetest.settings:get_bool("disable_fire")
|
||||
end
|
||||
|
||||
if not fire_enabled then
|
||||
|
|
|
@ -68,7 +68,7 @@ local go_fishing = function(itemstack, user, pointed_thing)
|
|||
if inv:room_for_item("main", item) then
|
||||
inv:add_item("main", item)
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
local idef = itemstack:get_definition()
|
||||
itemstack:add_wear(65535/65) -- 65 uses
|
||||
if itemstack:get_count() == 0 and idef.sound and idef.sound.breaks then
|
||||
|
|
|
@ -59,7 +59,7 @@ minetest.register_node("mcl_flowerpots:flower_pot", {
|
|||
local flower_node = row[2]
|
||||
if item == flower_node then
|
||||
minetest.swap_node(pos, {name="mcl_flowerpots:flower_pot_"..flower})
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
end
|
||||
|
@ -69,7 +69,7 @@ minetest.register_node("mcl_flowerpots:flower_pot", {
|
|||
local flower_node = row[2]
|
||||
if item == flower_node then
|
||||
minetest.swap_node(pos, {name="mcl_flowerpots:flower_pot_"..flower})
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
end
|
||||
|
|
|
@ -219,7 +219,7 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im
|
|||
minetest.sound_play(minetest.registered_nodes["mcl_flowers:"..name].sounds.place, {pos = bottom, gain=1})
|
||||
minetest.set_node(bottom, {name="mcl_flowers:"..name})
|
||||
minetest.set_node(top, {name="mcl_flowers:"..name.."_top"})
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
end
|
||||
|
@ -359,7 +359,7 @@ minetest.register_node("mcl_flowers:waterlily", {
|
|||
minetest.sound_play(idef.sounds.place, {pos=above, gain=1})
|
||||
end
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
else
|
||||
|
|
|
@ -97,7 +97,7 @@ Hoppers interact with containers the following way:
|
|||
else
|
||||
minetest.set_node(bpos, {name="mcl_hoppers:hopper", param2=0})
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
|
|
|
@ -6,7 +6,7 @@ local MP = minetest.get_modpath(minetest.get_current_modname())
|
|||
local S, NS = dofile(MP .. "/intllib.lua")
|
||||
|
||||
local spawn_silverfish = function(pos, oldnode, oldmetadata, digger)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
minetest.add_entity(pos, "mobs_mc:silverfish")
|
||||
end
|
||||
end
|
||||
|
|
|
@ -117,7 +117,7 @@ minetest.register_craftitem("mcl_nether:nether_wart_item", {
|
|||
minetest.sound_play({name="default_place_node", gain=1.0}, {pos=placepos})
|
||||
minetest.set_node(placepos, {name="mcl_nether:nether_wart_0", param2 = 3})
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
|
|
|
@ -350,7 +350,7 @@ minetest.register_node("mcl_signs:wall_sign", {
|
|||
text_entity:setyaw(sign_info.yaw)
|
||||
text_entity:get_luaentity()._signnodename = nodeitem:get_name()
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
minetest.sound_play({name="default_place_node_hard", gain=1.0}, {pos = place_pos})
|
||||
|
@ -476,6 +476,6 @@ minetest.register_alias("signs:sign_wall", "mcl_signs:wall_sign")
|
|||
minetest.register_alias("signs:sign_yard", "mcl_signs:standing_sign")
|
||||
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
if minetest.settings:get_bool("log_mods") then
|
||||
minetest.log("action", "[mcl_signs] loaded")
|
||||
end
|
||||
|
|
|
@ -61,7 +61,7 @@ minetest.register_node("mcl_sponges:sponge", {
|
|||
-- FIXME: pos is not always the right placement position because of pointed_thing
|
||||
if absorb(pos) then
|
||||
minetest.item_place_node(ItemStack("mcl_sponges:sponge_wet"), placer, pointed_thing)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
|
|
|
@ -165,7 +165,7 @@ function mcl_stairs.register_slab(subname, recipeitem, groups, images, descripti
|
|||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local under = minetest.get_node(pointed_thing.under)
|
||||
local wield_item = itemstack:get_name()
|
||||
local creative_enabled = minetest.setting_getbool("creative_mode")
|
||||
local creative_enabled = minetest.settings:get_bool("creative_mode")
|
||||
|
||||
-- place slab using under node orientation
|
||||
local dir = vector.subtract(pointed_thing.above, pointed_thing.under)
|
||||
|
|
|
@ -117,7 +117,7 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime)
|
|||
if self._lastpos.x~=nil then
|
||||
local def = minetest.registered_nodes[node.name]
|
||||
if (def and def.walkable) or not def then
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
minetest.add_item(self._lastpos, 'mcl_throwing:arrow')
|
||||
end
|
||||
self.object:remove()
|
||||
|
|
|
@ -53,7 +53,7 @@ end
|
|||
local player_shoot_arrow = function(itemstack, player, power, damage)
|
||||
local arrow_stack, arrow_stack_id = get_arrow(player)
|
||||
local arrow_itemstring
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
if not arrow_stack then
|
||||
return false
|
||||
end
|
||||
|
@ -86,7 +86,7 @@ local powerup_function = function(nextbow)
|
|||
end
|
||||
|
||||
-- Check for arrow or Creative Mode
|
||||
if minetest.setting_getbool("creative_mode") or get_arrow(placer) ~= nil then
|
||||
if minetest.settings:get_bool("creative_mode") or get_arrow(placer) ~= nil then
|
||||
local wear = itemstack:get_wear()
|
||||
itemstack:replace(nextbow)
|
||||
itemstack:set_wear(wear)
|
||||
|
@ -131,7 +131,7 @@ minetest.register_tool("mcl_throwing:bow_0", {
|
|||
itemstack:replace("mcl_throwing:bow")
|
||||
itemstack:set_wear(wear)
|
||||
if player_shoot_arrow(itemstack, user, 4, 1) then
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:add_wear(65535/bow_durability)
|
||||
end
|
||||
end
|
||||
|
@ -153,7 +153,7 @@ minetest.register_tool("mcl_throwing:bow_1", {
|
|||
itemstack:replace("mcl_throwing:bow")
|
||||
itemstack:set_wear(wear)
|
||||
if player_shoot_arrow(itemstack, user, 16, 2) then
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:add_wear(65535/bow_durability)
|
||||
end
|
||||
end
|
||||
|
@ -183,7 +183,7 @@ minetest.register_tool("mcl_throwing:bow_2", {
|
|||
damage = 4
|
||||
end
|
||||
if player_shoot_arrow(itemstack, user, 26, damage) then
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:add_wear(65535/bow_durability)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
-- Snowballs and other throwable items
|
||||
--
|
||||
|
||||
local GRAVITY = tonumber(minetest.setting_get("movement_gravity"))
|
||||
local GRAVITY = tonumber(minetest.settings:get("movement_gravity"))
|
||||
|
||||
local entity_mapping = {
|
||||
["mcl_throwing:snowball"] = "mcl_throwing:snowball_entity",
|
||||
|
@ -38,7 +38,7 @@ local throw_function = function(entity_name, velocity)
|
|||
local dir = player:get_look_dir()
|
||||
local obj = mcl_throwing.throw(item, {x=playerpos.x, y=playerpos.y+1.5, z=playerpos.z}, dir, velocity)
|
||||
obj:get_luaentity()._thrower = player:get_player_name()
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
item:take_item()
|
||||
end
|
||||
return item
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
-- The hand
|
||||
local groupcaps
|
||||
if minetest.setting_getbool("creative_mode") then
|
||||
if minetest.settings:get_bool("creative_mode") then
|
||||
-- Instant breaking in creative mode
|
||||
groupcaps = {
|
||||
creative_breakable = {times={[1]=0}, uses=0},
|
||||
|
@ -174,7 +174,7 @@ local make_grass_path = function(itemstack, placer, pointed_thing)
|
|||
local above = table.copy(pointed_thing.under)
|
||||
above.y = above.y + 1
|
||||
if minetest.get_node(above).name == "air" then
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
-- Add wear, as if digging a level 0 shovely node
|
||||
local toolname = itemstack:get_name()
|
||||
local def = minetest.registered_items[toolname]
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
local time = 0
|
||||
local update_time = tonumber(minetest.setting_get("wieldview_update_time"))
|
||||
local update_time = tonumber(minetest.settings:get("wieldview_update_time"))
|
||||
if not update_time then
|
||||
update_time = 2
|
||||
minetest.setting_set("wieldview_update_time", tostring(update_time))
|
||||
minetest.settings:set("wieldview_update_time", tostring(update_time))
|
||||
end
|
||||
local node_tiles = minetest.setting_getbool("wieldview_node_tiles")
|
||||
local node_tiles = minetest.settings:get_bool("wieldview_node_tiles")
|
||||
if not node_tiles then
|
||||
node_tiles = false
|
||||
minetest.setting_set("wieldview_node_tiles", "false")
|
||||
minetest.settings:set("wieldview_node_tiles", "false")
|
||||
end
|
||||
|
||||
wieldview = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue