From fbb8a7e0a6edde076896b353043d51be042bab55 Mon Sep 17 00:00:00 2001 From: Skamiz Kazzarch <48406239+Skamiz@users.noreply.github.com> Date: Sun, 16 May 2021 16:48:04 +0200 Subject: [PATCH] update to minetest 5.4 update depreciated calls fix issues caused by changes in the engine fix crashes in mobs_redo --- TODO.txt | 1 + mods/3d_armor/armor.lua | 12 +- mods/3d_armor_stand/init.lua | 9 +- mods/backpack/nodes.lua | 3 +- mods/beds/api.lua | 3 +- mods/beds/functions.lua | 12 +- mods/beds/spawns.lua | 2 +- mods/boats/init.lua | 64 +-- mods/bones/init.lua | 13 +- mods/bucket/init.lua | 2 +- mods/carts/cart_entity.lua | 32 +- mods/clawshot/init.lua | 6 +- mods/craftguide/init.lua | 3 +- mods/creative/init.lua | 2 +- mods/creative/inventory.lua | 4 +- mods/decoblocks/lantern.lua | 8 +- mods/decoblocks/nodes.lua | 47 +- mods/default/craftitems.lua | 4 +- mods/default/item_entity.lua | 8 +- mods/default/nodes.lua | 82 ++-- mods/default/player.lua | 7 +- .../default_river_water_flowing_animated.png | Bin 837 -> 312 bytes ...ult_river_water_flowing_animated_alpha.png | Bin 0 -> 837 bytes .../default_water_flowing_animated.png | Bin 838 -> 312 bytes .../default_water_flowing_animated_alpha.png | Bin 0 -> 780 bytes mods/default/torch.lua | 4 +- mods/doors/init.lua | 22 +- mods/farming/hoes.lua | 2 +- mods/farming/init.lua | 5 +- mods/farming/melon.lua | 2 + mods/farming/pumpkin.lua | 4 +- mods/fire/init.lua | 10 +- mods/fireworks/init.lua | 41 +- mods/flowerpots/nodes.lua | 9 +- mods/flowers/init.lua | 3 +- mods/flowers_plus/init.lua | 9 +- mods/give_initial_stuff/init.lua | 4 +- mods/hud_hunger/hud/builtin.lua | 8 +- mods/hud_hunger/hunger/functions.lua | 12 +- .../hunger/functions_(nosprint).lua | 6 +- mods/hud_hunger/hunger/init.lua | 2 +- mods/hud_hunger/hunger/init_(nosprint).lua | 2 +- mods/item_drop/init.lua | 20 +- mods/mapgen/mapgen.lua | 176 ++++---- mods/mapgen/nodes.lua | 152 ++++--- .../mapgen_dirty_water_flowing_animated.png | Bin 839 -> 312 bytes ...gen_dirty_water_flowing_animated_alpha.png | Bin 0 -> 839 bytes mods/mines/init.lua | 6 +- mods/mobs_farlands/flying.lua | 2 +- mods/mobs_farlands/land.lua | 28 +- mods/mobs_npc/igor.lua | 4 +- mods/mobs_npc/init.lua | 4 +- mods/mobs_npc/npc.lua | 46 +- mods/mobs_redo/api.lua | 177 ++++---- mods/mobs_redo/api.txt | 2 +- mods/mobs_redo/depends.txt | 1 + mods/mobs_redo/mount.lua | 44 +- mods/mobs_redo/spawner.lua | 2 +- mods/paintings/init.lua | 10 +- mods/playereffects/init.lua | 20 +- mods/screwdriver/init.lua | 2 +- mods/sethome/init.lua | 4 +- mods/stairs/depends.txt | 1 + mods/stairs/init.lua | 6 +- mods/stm_nodes/init.lua | 87 ++-- mods/tnt/init.lua | 16 +- mods/tools/init.lua | 4 +- mods/vehicles/api.lua | 118 ++--- mods/weather/init.lua | 58 ++- mods/wieldview/init.lua | 9 +- mods/witchcraft/brewing_stand.lua | 12 +- mods/witchcraft/init.lua | 411 +++++++++--------- mods/witchcraft/init_old.lua | 106 ++--- mods/witchcraft/scrolls.lua | 54 +-- mods/workbench/init.lua | 2 +- mods/xpanes/init.lua | 6 +- 76 files changed, 1105 insertions(+), 954 deletions(-) create mode 100644 TODO.txt create mode 100644 mods/default/textures/default_river_water_flowing_animated_alpha.png create mode 100644 mods/default/textures/default_water_flowing_animated_alpha.png create mode 100644 mods/mapgen/textures/mapgen_dirty_water_flowing_animated_alpha.png diff --git a/TODO.txt b/TODO.txt new file mode 100644 index 0000000..9a7b16b --- /dev/null +++ b/TODO.txt @@ -0,0 +1 @@ +mapgen:bamboo_grass isn't buidable_to diff --git a/mods/3d_armor/armor.lua b/mods/3d_armor/armor.lua index 5d620d9..47204b1 100644 --- a/mods/3d_armor/armor.lua +++ b/mods/3d_armor/armor.lua @@ -233,7 +233,7 @@ end armor.update_armor = function(self, player) -- Legacy support: Called when armor levels are changed - -- Other mods can hook on to this function, see hud mod for example + -- Other mods can hook on to this function, see hud mod for example end armor.get_player_skin = function(self, name) @@ -290,7 +290,7 @@ armor.update_inventory = function(self, player) if page:find("detached:"..name.."_armor") then inventory_plus.set_inventory_formspec(player, formspec) end - elseif not core.setting_getbool("creative_mode") then + elseif not minetest.settings:get_bool("creative_mode") then player:set_inventory_formspec(formspec) end end @@ -307,7 +307,7 @@ armor.get_valid_player = function(self, player, msg) minetest.log("error", "3d_armor: Player name is nil "..msg) return end - local pos = player:getpos() + local pos = player:get_pos() local player_inv = player:get_inventory() local armor_inv = minetest.get_inventory({type="detached", name=name.."_armor"}) if not pos then @@ -406,7 +406,7 @@ minetest.register_on_joinplayer(function(player) for i=1, 6 do local stack = player_inv:get_stack("armor", i) armor_inv:set_stack("armor", i, stack) - end + end armor.def[name] = { state = 0, count = 0, @@ -468,7 +468,7 @@ if ARMOR_DROP == true or ARMOR_DESTROY == true then armor.drop_armor = function(pos, stack) local obj = minetest.add_item(pos, stack) if obj then - obj:setvelocity({x=math.random(-1, 1), y=5, z=math.random(-1, 1)}) + obj:set_velocity({x=math.random(-1, 1), y=5, z=math.random(-1, 1)}) end end minetest.register_on_dieplayer(function(player) @@ -591,7 +591,7 @@ minetest.register_globalstep(function(dtime) end for _,player in pairs(minetest.get_connected_players()) do local name = player:get_player_name() - local pos = player:getpos() + local pos = player:get_pos() local hp = player:get_hp() -- water breathing if name and armor.def[name].water > 0 then diff --git a/mods/3d_armor_stand/init.lua b/mods/3d_armor_stand/init.lua index 86c5729..777950c 100644 --- a/mods/3d_armor_stand/init.lua +++ b/mods/3d_armor_stand/init.lua @@ -79,7 +79,7 @@ local function update_entity(pos) yaw = math.pi / 2 end end - object:setyaw(yaw) + object:set_yaw(yaw) object:set_properties({textures={texture}}) end end @@ -103,6 +103,7 @@ minetest.register_node("3d_armor_stand:armor_stand", { drawtype = "mesh", mesh = "3d_armor_stand.obj", tiles = {"3d_armor_stand.png"}, + use_texture_alpha = "opaque", paramtype = "light", paramtype2 = "facedir", walkable = false, @@ -170,6 +171,7 @@ minetest.register_node("3d_armor_stand:locked_armor_stand", { drawtype = "mesh", mesh = "3d_armor_stand.obj", tiles = {"3d_armor_stand_locked.png"}, + use_texture_alpha = "opaque", paramtype = "light", paramtype2 = "facedir", walkable = false, @@ -258,7 +260,7 @@ minetest.register_entity("3d_armor_stand:armor_entity", { pos = nil, timer = 0, on_activate = function(self) - local pos = self.object:getpos() + local pos = self.object:get_pos() if pos then self.pos = vector.round(pos) update_entity(pos) @@ -271,7 +273,7 @@ minetest.register_entity("3d_armor_stand:armor_entity", { self.timer = self.timer + dtime if self.timer > 1 then self.timer = 0 - local pos = self.object:getpos() + local pos = self.object:get_pos() if pos then if vector.equals(vector.round(pos), self.pos) then return @@ -298,4 +300,3 @@ minetest.register_craft({ {"3d_armor_stand:armor_stand", "default:steel_ingot"}, } }) - diff --git a/mods/backpack/nodes.lua b/mods/backpack/nodes.lua index aded065..5f5c47f 100644 --- a/mods/backpack/nodes.lua +++ b/mods/backpack/nodes.lua @@ -5,6 +5,7 @@ minetest.register_node("backpack:backpack", { tiles = { "backpack.png", }, + use_texture_alpha = "opaque", visual_scale = 0.5, wield_image = "backpack_item.png", wield_scale = {x=1.0, y=1.0, z=1.0}, @@ -21,4 +22,4 @@ minetest.register_node("backpack:backpack", { inventory_image = "backpack_item.png", groups = {choppy = 1, oddly_breakable_by_hand = 1}, sounds = default.node_sound_wood_defaults() -}) \ No newline at end of file +}) diff --git a/mods/beds/api.lua b/mods/beds/api.lua index 7244c8b..fbb7f9c 100644 --- a/mods/beds/api.lua +++ b/mods/beds/api.lua @@ -30,6 +30,7 @@ function beds.register_bed(name, def) drawtype = "mesh", mesh = "bed.obj", tiles = def.tiles, + use_texture_alpha = "opaque", visual_scale = 0.5, paramtype = "light", paramtype2 = "facedir", @@ -79,7 +80,7 @@ function 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 diff --git a/mods/beds/functions.lua b/mods/beds/functions.lua index bfe232a..6cb3b17 100644 --- a/mods/beds/functions.lua +++ b/mods/beds/functions.lua @@ -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 @@ -65,7 +65,7 @@ local function lay_down(player, pos, bed_pos, state, skip) return end if p then - player:setpos(p) + player:set_pos(p) end -- physics, eye_offset, etc @@ -91,7 +91,7 @@ local function lay_down(player, pos, bed_pos, state, skip) print(dump(player:get_physics_override())) player:set_physics_override(0, 0, 0) print(dump(player:get_physics_override())) - player:setpos(p) + player:set_pos(p) default.player_attached[name] = true hud_flags.wielditem = false default.player_set_animation(player, "lay" , 0) @@ -136,7 +136,7 @@ end function beds.on_rightclick(pos, player) local name = player:get_player_name() - local ppos = player:getpos() + local ppos = player:get_pos() local tod = minetest.get_timeofday() if tod > 0.2 and tod < 0.805 then @@ -182,7 +182,7 @@ if enable_respawn then local name = player:get_player_name() local pos = beds.spawn[name] if pos then - player:setpos(pos) + player:set_pos(pos) return true end end) diff --git a/mods/beds/spawns.lua b/mods/beds/spawns.lua index 6b1f404..baee364 100644 --- a/mods/beds/spawns.lua +++ b/mods/beds/spawns.lua @@ -53,7 +53,7 @@ end function beds.set_spawns() for name,_ in pairs(beds.player) do local player = minetest.get_player_by_name(name) - local p = player:getpos() + local p = player:get_pos() -- but don't change spawn location if borrowing a bed if not minetest.is_protected(p, name) then beds.spawn[name] = p diff --git a/mods/boats/init.lua b/mods/boats/init.lua index 547c98e..78e2376 100644 --- a/mods/boats/init.lua +++ b/mods/boats/init.lua @@ -58,10 +58,10 @@ function boat.on_rightclick(self, clicker) clicker:set_detach() default.player_attached[name] = false default.player_set_animation(clicker, "stand" , 30) - local pos = clicker:getpos() + local pos = clicker:get_pos() pos = {x = pos.x, y = pos.y + 0.2, z = pos.z} minetest.after(0.1, function() - clicker:setpos(pos) + clicker:set_pos(pos) end) elseif not self.driver then local attach = clicker:get_attach() @@ -79,7 +79,7 @@ function boat.on_rightclick(self, clicker) minetest.after(0.2, function() default.player_set_animation(clicker, "sit" , 30) end) - clicker:set_look_horizontal(self.object:getyaw()) + clicker:set_look_horizontal(self.object:get_yaw()) end end @@ -110,12 +110,12 @@ function boat.on_punch(self, puncher) if not self.driver then self.removed = true local inv = puncher:get_inventory() - if not minetest.setting_getbool("creative_mode") + if not minetest.settings:get_bool("creative_mode") or not inv:contains_item("main", "boats:boat") then local leftover = inv:add_item("main", "boats:boat") -- if no room in inventory add a replacement boat to the world if not leftover:is_empty() then - minetest.add_item(self.object:getpos(), leftover) + minetest.add_item(self.object:get_pos(), leftover) end end -- delay remove to ensure player is detached @@ -127,10 +127,10 @@ end function boat.on_step(self, dtime) - self.v = get_v(self.object:getvelocity()) * get_sign(self.v) + self.v = get_v(self.object:get_velocity()) * get_sign(self.v) if self.driver then local ctrl = self.driver:get_player_control() - local yaw = self.object:getyaw() + local yaw = self.object:get_yaw() if ctrl.up then self.v = self.v + 0.1 elseif ctrl.down then @@ -138,27 +138,27 @@ function boat.on_step(self, dtime) end if ctrl.left then if self.v < 0 then - self.object:setyaw(yaw - (1 + dtime) * 0.03) + self.object:set_yaw(yaw - (1 + dtime) * 0.03) else - self.object:setyaw(yaw + (1 + dtime) * 0.03) + self.object:set_yaw(yaw + (1 + dtime) * 0.03) end elseif ctrl.right then if self.v < 0 then - self.object:setyaw(yaw + (1 + dtime) * 0.03) + self.object:set_yaw(yaw + (1 + dtime) * 0.03) else - self.object:setyaw(yaw - (1 + dtime) * 0.03) + self.object:set_yaw(yaw - (1 + dtime) * 0.03) end end end - local velo = self.object:getvelocity() + local velo = self.object:get_velocity() if self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then - self.object:setpos(self.object:getpos()) + self.object:set_pos(self.object:get_pos()) return end local s = get_sign(self.v) self.v = self.v - 0.02 * s if s ~= get_sign(self.v) then - self.object:setvelocity({x = 0, y = 0, z = 0}) + self.object:set_velocity({x = 0, y = 0, z = 0}) self.v = 0 return end @@ -166,7 +166,7 @@ function boat.on_step(self, dtime) self.v = 5 * get_sign(self.v) end - local p = self.object:getpos() + local p = self.object:get_pos() p.y = p.y - 0.5 local new_velo local new_acce = {x = 0, y = 0, z = 0} @@ -178,13 +178,13 @@ function boat.on_step(self, dtime) else new_acce = {x = 0, y = -9.8, z = 0} end - new_velo = get_velocity(self.v, self.object:getyaw(), - self.object:getvelocity().y) - self.object:setpos(self.object:getpos()) + new_velo = get_velocity(self.v, self.object:get_yaw(), + self.object:get_velocity().y) + self.object:set_pos(self.object:get_pos()) else p.y = p.y + 1 if is_water(p) then - local y = self.object:getvelocity().y + local y = self.object:get_velocity().y if y >= 5 then y = 5 elseif y < 0 then @@ -192,24 +192,24 @@ function boat.on_step(self, dtime) else new_acce = {x = 0, y = 5, z = 0} end - new_velo = get_velocity(self.v, self.object:getyaw(), y) - self.object:setpos(self.object:getpos()) + new_velo = get_velocity(self.v, self.object:get_yaw(), y) + self.object:set_pos(self.object:get_pos()) else new_acce = {x = 0, y = 0, z = 0} - if math.abs(self.object:getvelocity().y) < 1 then - local pos = self.object:getpos() + if math.abs(self.object:get_velocity().y) < 1 then + local pos = self.object:get_pos() pos.y = math.floor(pos.y) + 0.5 - self.object:setpos(pos) - new_velo = get_velocity(self.v, self.object:getyaw(), 0) + self.object:set_pos(pos) + new_velo = get_velocity(self.v, self.object:get_yaw(), 0) else - new_velo = get_velocity(self.v, self.object:getyaw(), - self.object:getvelocity().y) - self.object:setpos(self.object:getpos()) + new_velo = get_velocity(self.v, self.object:get_yaw(), + self.object:get_velocity().y) + self.object:set_pos(self.object:get_pos()) end end end - self.object:setvelocity(new_velo) - self.object:setacceleration(new_acce) + self.object:set_velocity(new_velo) + self.object:set_acceleration(new_acce) end @@ -233,8 +233,8 @@ minetest.register_craftitem("boats:boat", { pointed_thing.under.y = pointed_thing.under.y + 0.5 boat = minetest.add_entity(pointed_thing.under, "boats:boat") if boat then - boat:setyaw(placer:get_look_horizontal()) - if not minetest.setting_getbool("creative_mode") then + boat:set_yaw(placer:get_look_horizontal()) + if not minetest.settings:get_bool("creative_mode") then itemstack:take_item() end end diff --git a/mods/bones/init.lua b/mods/bones/init.lua index 0574119..bd4f856 100644 --- a/mods/bones/init.lua +++ b/mods/bones/init.lua @@ -21,8 +21,8 @@ local bones_formspec = "listring[current_player;main]" .. default.get_hotbar_bg(0,4.85) -local share_bones_time = tonumber(minetest.setting_get("share_bones_time")) or 1200 -local share_bones_time_early = tonumber(minetest.setting_get("share_bones_time_early")) or share_bones_time / 4 +local share_bones_time = tonumber(minetest.settings:get("share_bones_time")) or 1200 +local share_bones_time_early = tonumber(minetest.settings:get("share_bones_time_early")) or share_bones_time / 4 minetest.register_node("bones:bones", { description = "Bones", @@ -31,6 +31,7 @@ minetest.register_node("bones:bones", { tiles = { "tombstone.png", }, + use_texture_alpha = "opaque", visual_scale = 0.5, wield_image = "tombstone_item.png", wield_scale = {x=1.0, y=1.0, z=1.0}, @@ -161,7 +162,7 @@ end local drop = function(pos, itemstack) local obj = minetest.add_item(pos, itemstack:take_item(itemstack:get_count())) if obj then - obj:setvelocity({ + obj:set_velocity({ x = math.random(-10, 10) / 9, y = 5, z = math.random(-10, 10) / 9, @@ -171,13 +172,13 @@ end minetest.register_on_dieplayer(function(player) - local bones_mode = minetest.setting_get("bones_mode") or "bones" + local bones_mode = minetest.settings:get("bones_mode") or "bones" if bones_mode ~= "bones" and bones_mode ~= "drop" and bones_mode ~= "keep" then bones_mode = "bones" end -- return if keep inventory set or in creative mode - if bones_mode == "keep" or minetest.setting_getbool("creative_mode") then + if bones_mode == "keep" or minetest.settings:get_bool("creative_mode") then return end @@ -187,7 +188,7 @@ minetest.register_on_dieplayer(function(player) return end - local pos = vector.round(player:getpos()) + local pos = vector.round(player:get_pos()) local player_name = player:get_player_name() -- check if it's possible to place bones, if not find space near player diff --git a/mods/bucket/init.lua b/mods/bucket/init.lua index 2ed3325..5b5db94 100644 --- a/mods/bucket/init.lua +++ b/mods/bucket/init.lua @@ -147,7 +147,7 @@ minetest.register_craftitem("bucket:bucket_empty", { if inv:room_for_item("main", {name=liquiddef.itemname}) then inv:add_item("main", liquiddef.itemname) else - local pos = user:getpos() + local pos = user:get_pos() pos.y = math.floor(pos.y + 0.5) minetest.add_item(pos, liquiddef.itemname) end diff --git a/mods/carts/cart_entity.lua b/mods/carts/cart_entity.lua index 427a0a8..f704072 100644 --- a/mods/carts/cart_entity.lua +++ b/mods/carts/cart_entity.lua @@ -57,7 +57,7 @@ function cart_entity:get_staticdata() end function cart_entity:on_punch(puncher, time_from_last_punch, tool_capabilities, direction) - local pos = self.object:getpos() + local pos = self.object:get_pos() if not self.railtype then local node = minetest.get_node(pos).name self.railtype = minetest.get_item_group(node, "connect_to_raillike") @@ -80,7 +80,7 @@ function cart_entity:on_punch(puncher, time_from_last_punch, tool_capabilities, -- Detach driver and items if self.driver then if self.old_pos then - self.object:setpos(self.old_pos) + self.object:set_pos(self.old_pos) end local player = minetest.get_player_by_name(self.driver) carts:manage_attachment(player, nil) @@ -92,19 +92,19 @@ function cart_entity:on_punch(puncher, time_from_last_punch, tool_capabilities, end -- Pick up cart local inv = puncher:get_inventory() - if not minetest.setting_getbool("creative_mode") + if not minetest.settings:get_bool("creative_mode") or not inv:contains_item("main", "carts:cart") then local leftover = inv:add_item("main", "carts:cart") -- If no room in inventory add a replacement cart to the world if not leftover:is_empty() then - minetest.add_item(self.object:getpos(), leftover) + minetest.add_item(self.object:get_pos(), leftover) end end self.object:remove() return end -- Player punches cart to alter velocity - local vel = self.object:getvelocity() + local vel = self.object:get_velocity() if puncher:get_player_name() == self.driver then if math.abs(vel.x + vel.z) > carts.punch_speed_max then return @@ -151,7 +151,7 @@ local function rail_sound(self, dtime) self.sound_handle = nil minetest.after(0.2, minetest.sound_stop, handle) end - local vel = self.object:getvelocity() + local vel = self.object:get_velocity() local speed = vector.length(vel) if speed > 0 then self.sound_handle = minetest.sound_play( @@ -169,16 +169,16 @@ local function get_railparams(pos) end local function rail_on_step(self, dtime) - local vel = self.object:getvelocity() + local vel = self.object:get_velocity() if self.punched then vel = vector.add(vel, self.velocity) - self.object:setvelocity(vel) + self.object:set_velocity(vel) self.old_dir.y = 0 elseif vector.equals(vel, {x=0, y=0, z=0}) then return end - local pos = self.object:getpos() + local pos = self.object:get_pos() local update = {} -- stop cart if velocity vector flips @@ -186,8 +186,8 @@ local function rail_on_step(self, dtime) (self.old_vel.x * vel.x < 0 or self.old_vel.z * vel.z < 0) then self.old_vel = {x = 0, y = 0, z = 0} self.old_pos = pos - self.object:setvelocity(vector.new()) - self.object:setacceleration(vector.new()) + self.object:set_velocity(vector.new()) + self.object:set_acceleration(vector.new()) rail_on_step_event(get_railparams(pos).on_step, self, dtime) return end @@ -293,7 +293,7 @@ local function rail_on_step(self, dtime) end end - self.object:setacceleration(new_acc) + self.object:set_acceleration(new_acc) self.old_pos = vector.new(pos) if not vector.equals(dir, {x=0, y=0, z=0}) then self.old_dir = vector.new(dir) @@ -331,7 +331,7 @@ local function rail_on_step(self, dtime) elseif self.old_dir.z < 0 then yaw = 1 end - self.object:setyaw(yaw * math.pi) + self.object:set_yaw(yaw * math.pi) local anim = {x=0, y=0} if dir.y == -1 then @@ -341,9 +341,9 @@ local function rail_on_step(self, dtime) end self.object:set_animation(anim, 1, 0) - self.object:setvelocity(vel) + self.object:set_velocity(vel) if update.pos then - self.object:setpos(pos) + self.object:set_pos(pos) end -- call event handler @@ -376,7 +376,7 @@ minetest.register_craftitem("carts:cart", { minetest.sound_play({name = "default_place_node_metal", gain = 0.5}, {pos = pointed_thing.above}) - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then itemstack:take_item() end return itemstack diff --git a/mods/clawshot/init.lua b/mods/clawshot/init.lua index 562d3c2..d26062b 100644 --- a/mods/clawshot/init.lua +++ b/mods/clawshot/init.lua @@ -12,7 +12,7 @@ local function check_for_mobs(pos, self) full_punch_interval=2.0, damage_groups={fleshy=1}, }, nil) - self.object:setvelocity(vector.multiply(self.object:getvelocity(), -1)) + self.object:set_velocity(vector.multiply(self.object:get_velocity(), -1)) self.timeout = self.timer break end @@ -58,7 +58,7 @@ local function register_clawshot(def) self.object:remove() return end - local pos = self.object:getpos() + local pos = self.object:get_pos() check_for_mobs(pos, self) minetest.add_particle({ @@ -78,7 +78,7 @@ local function register_clawshot(def) minetest.get_item_group(node_name, "choppy") == 0 then return end - local player_pos = self.launcher:getpos() + local player_pos = self.launcher:get_pos() local attach_obj = minetest.add_entity(player_pos, "clawshot:dummy") self.launcher:set_attach(attach_obj, "", {x=0, y=0, z=0}, {x=0, y=0.9, z=0}) diff --git a/mods/craftguide/init.lua b/mods/craftguide/init.lua index 517a365..6d922ee 100644 --- a/mods/craftguide/init.lua +++ b/mods/craftguide/init.lua @@ -1,5 +1,5 @@ local craftguide, datas, mt = {}, {}, minetest -local progressive_mode = mt.setting_getbool("craftguide_progressive_mode") +local progressive_mode = mt.settings:get_bool("craftguide_progressive_mode") local get_recipe, get_recipes = mt.get_craft_recipe, mt.get_all_craft_recipes local get_result, show_formspec = mt.get_craft_result, mt.show_formspec local reg_items = mt.registered_items @@ -422,6 +422,7 @@ mt.register_node("craftguide:sign", { description = "Crafting Guide Sign", drawtype = "nodebox", tiles = {"craftguide_sign.png"}, + use_texture_alpha = "opaque", inventory_image = "craftguide_sign_inv.png", wield_image = "craftguide_sign_inv.png", paramtype = "light", diff --git a/mods/creative/init.lua b/mods/creative/init.lua index 868b802..143df47 100644 --- a/mods/creative/init.lua +++ b/mods/creative/init.lua @@ -1,6 +1,6 @@ dofile(minetest.get_modpath("creative") .. "/inventory.lua") -if minetest.setting_getbool("creative_mode") then +if minetest.settings:get_bool("creative_mode") then -- Dig time is modified according to difference (leveldiff) between tool -- 'maxlevel' and node 'level'. Digtime is divided by the larger of -- leveldiff and 1. diff --git a/mods/creative/inventory.lua b/mods/creative/inventory.lua index be24b3a..f70384a 100644 --- a/mods/creative/inventory.lua +++ b/mods/creative/inventory.lua @@ -79,7 +79,7 @@ function creative.register_tab(name, title, items) sfinv.register_page("creative:" .. name, { title = title, is_in_nav = function(self, player, context) - return minetest.setting_getbool("creative_mode") + return minetest.settings:get_bool("creative_mode") end, get = function(self, player, context) local player_name = player:get_player_name() @@ -172,7 +172,7 @@ creative.register_tab("craftitems", "Items", minetest.registered_craftitems) local old_homepage_name = sfinv.get_homepage_name function sfinv.get_homepage_name(player) - if minetest.setting_getbool("creative_mode") then + if minetest.settings:get_bool("creative_mode") then return "creative:all" else return old_homepage_name(player) diff --git a/mods/decoblocks/lantern.lua b/mods/decoblocks/lantern.lua index a527344..1730346 100644 --- a/mods/decoblocks/lantern.lua +++ b/mods/decoblocks/lantern.lua @@ -41,6 +41,7 @@ minetest.register_node("decoblocks:lantern", { name = "decoblocks_lantern.png", animation = {type = "vertical_frames", aspect_w = 32, aspect_h = 32, length = 3.3} }}, + use_texture_alpha = "clip", paramtype = "light", paramtype2 = "wallmounted", sunlight_propagates = true, @@ -88,7 +89,7 @@ minetest.register_abm({ chance = 1, action = function(pos, node) if minetest.get_timeofday() <= 0.6 and minetest.get_timeofday() >= 0.2 then - return + return end minetest.add_particle({ pos = {x=pos.x, y=pos.y, z=pos.z}, @@ -113,6 +114,7 @@ minetest.register_node("decoblocks:lantern_wall", { name = "decoblocks_lantern.png", animation = {type = "vertical_frames", aspect_w = 32, aspect_h = 32, length = 3.3} }}, + use_texture_alpha = "clip", paramtype = "light", paramtype2 = "wallmounted", sunlight_propagates = true, @@ -133,7 +135,7 @@ minetest.register_abm({ chance = 1, action = function(pos, node) if minetest.get_timeofday() <= 0.6 and minetest.get_timeofday() >= 0.2 then - return + return end local dir = minetest.facedir_to_dir(node.param2) --minetest.chat_send_all(dir.x.." z:"..dir.z) @@ -168,6 +170,7 @@ minetest.register_node("decoblocks:lantern_ceiling", { name = "decoblocks_lantern.png", animation = {type = "vertical_frames", aspect_w = 32, aspect_h = 32, length = 3.3} }}, + use_texture_alpha = "clip", paramtype = "light", paramtype2 = "wallmounted", sunlight_propagates = true, @@ -198,4 +201,3 @@ minetest.register_lbm({ end end }) - diff --git a/mods/decoblocks/nodes.lua b/mods/decoblocks/nodes.lua index e6a9132..803e3a1 100644 --- a/mods/decoblocks/nodes.lua +++ b/mods/decoblocks/nodes.lua @@ -5,6 +5,7 @@ minetest.register_node("decoblocks:bamboo_fence", { "decoblocks_bamboo_fence_top.png", "decoblocks_bamboo_fence.png", }, + use_texture_alpha = "opaque", inventory_image = "default_fence_overlay.png^decoblocks_bamboo.png^default_fence_overlay.png^[makealpha:255,126,126", wield_image = "default_fence_overlay.png^decoblocks_bamboo.png^default_fence_overlay.png^[makealpha:255,126,126", drawtype = "nodebox", @@ -229,6 +230,7 @@ minetest.register_node("decoblocks:scarecrow", { tiles = { "decoblocks_scarecrow.png", }, + use_texture_alpha = "clip", visual_scale = 0.5, wield_image = "decoblocks_scarecrow_item.png", wield_scale = {x=1.0, y=1.0, z=1.0}, @@ -254,6 +256,7 @@ minetest.register_node("decoblocks:human_skull", { tiles = { "human_skull.png", }, + use_texture_alpha = "clip", visual_scale = 0.5, wield_image = "decoblocks_skull_item.png", wield_scale = {x=1.0, y=1.0, z=1.0}, @@ -280,6 +283,7 @@ minetest.register_node("decoblocks:vase", { tiles = { "vase.png", }, + use_texture_alpha = "clip", visual_scale = 0.5, wield_scale = {x=0.5, y=0.5, z=0.5}, paramtype = "light", @@ -296,13 +300,14 @@ minetest.register_node("decoblocks:vase", { }) -minetest.register_node("decoblocks:Ancient_vase", { +minetest.register_node("decoblocks:ancient_vase", { description = "Ancient Vase", drawtype = "mesh", mesh = "vase.obj", tiles = { "Ancient_vase.png", }, + use_texture_alpha = "clip", visual_scale = 0.5, wield_scale = {x=0.5, y=0.5, z=0.5}, paramtype = "light", @@ -318,13 +323,14 @@ minetest.register_node("decoblocks:Ancient_vase", { sounds = default.node_sound_stone_defaults(), }) -minetest.register_node("decoblocks:Ancient_vase_sand", { +minetest.register_node("decoblocks:ancient_vase_sand", { description = "Sandstone Vase", drawtype = "mesh", mesh = "vase.obj", tiles = { "Ancient_vase_sand.png", }, + use_texture_alpha = "clip", visual_scale = 0.5, wield_scale = {x=0.5, y=0.5, z=0.5}, paramtype = "light", @@ -432,8 +438,8 @@ minetest.register_entity("decoblocks:dart", { end) end, on_step = function(self, dtime) - local pos = self.object:getpos() - local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y-0.5,z=pos.z}, 0.5) + local pos = self.object:get_pos() + local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y-0.5,z=pos.z}, 0.5) for k, obj in pairs(objs) do if obj:is_player() then obj:punch(self.object, 1.0, { @@ -476,8 +482,8 @@ minetest.register_entity("decoblocks:dart2", { end) end, on_step = function(self, dtime) - local pos = self.object:getpos() - local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y-0.5,z=pos.z}, 0.5) + local pos = self.object:get_pos() + local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y-0.5,z=pos.z}, 0.5) for k, obj in pairs(objs) do if obj:is_player() then obj:punch(self.object, 1.0, { @@ -576,7 +582,7 @@ minetest.register_abm({ for _, obj in ipairs(objs) do if obj:is_player() then local ent = minetest.env:add_entity(pos, "decoblocks:dart") - ent:setvelocity({x=7*x, y=0, z=7*z}) + ent:set_velocity({x=7*x, y=0, z=7*z}) end end end @@ -637,7 +643,7 @@ minetest.register_abm({ texture = "default_stone.png" }) minetest.set_node(pos, {name = "air"}) - + end end end @@ -648,16 +654,16 @@ minetest.register_tool("decoblocks:blowpipe", { inventory_image = "decoblocks_blowdart.png", on_use = function(itemstack, placer) local dir = placer:get_look_dir() - local pos = placer:getpos() + local pos = placer:get_pos() local pname = placer:get_player_name(); inv = minetest.get_inventory({type="player", name=pname}) if inv:contains_item("main", "decoblocks:dart_item2") then local ent = minetest.env:add_entity({x=pos.x+1*dir.x, y=pos.y+1.5, z=pos.z+1*dir.z}, "decoblocks:dart2") - ent:setvelocity({x=15*dir.x, y=15*dir.y, z=15*dir.z}) + ent:set_velocity({x=15*dir.x, y=15*dir.y, z=15*dir.z}) local remov = inv:remove_item("main", "decoblocks:dart_item2") elseif inv:contains_item("main", "decoblocks:dart_item") then local ent = minetest.env:add_entity({x=pos.x+1*dir.x, y=pos.y+1.5, z=pos.z+1*dir.z}, "decoblocks:dart") - ent:setvelocity({x=15*dir.x, y=15*dir.y, z=15*dir.z}) + ent:set_velocity({x=15*dir.x, y=15*dir.y, z=15*dir.z}) local remov = inv:remove_item("main", "decoblocks:dart_item") end end, @@ -680,6 +686,7 @@ minetest.register_node("decoblocks:old_skeleton", { tiles = { "decoblocks_old_skeleton.png", }, + use_texture_alpha = "clip", visual_scale = 0.5, wield_image = "decoblocks_skull_item.png", wield_scale = {x=1.0, y=1.0, z=1.0}, @@ -705,6 +712,7 @@ minetest.register_node("decoblocks:old_skeleton_alt", { tiles = { "decoblocks_old_skeleton.png", }, + use_texture_alpha = "clip", visual_scale = 0.5, wield_image = "decoblocks_skull_item.png", wield_scale = {x=1.0, y=1.0, z=1.0}, @@ -730,6 +738,7 @@ minetest.register_node("decoblocks:candle", { tiles = { "decoblocks_candle.png", }, + use_texture_alpha = "opaque", visual_scale = 0.5, wield_image = "decoblocks_candle_item.png", wield_scale = {x=1.0, y=1.0, z=1.0}, @@ -838,6 +847,7 @@ minetest.register_node("decoblocks:altar", { tiles = { "decoblocks_altar.png", }, + use_texture_alpha = "opaque", visual_scale = 0.5, wield_scale = {x=1.0, y=1.0, z=1.0}, paramtype = "light", @@ -859,9 +869,10 @@ minetest.register_node("decoblocks:anvil", { drawtype = "mesh", mesh = "anvil.obj", paramtype2 = "facedir", -tiles = { + tiles = { "decoblocks_anvil.png", }, + use_texture_alpha = "opaque", visual_scale = 0.5, wield_scale = {x=1.0, y=1.0, z=1.0}, paramtype = "light", @@ -902,6 +913,7 @@ minetest.register_node("decoblocks:D00Med_Statue", { tiles = { "decoblocks_D00Med_statue.png", }, + use_texture_alpha = "clip", visual_scale = 0.5, wield_scale = {x=1.0, y=1.0, z=1.0}, paramtype = "light", @@ -925,6 +937,7 @@ minetest.register_node("decoblocks:toby109tt_Statue", { tiles = { "decoblocks_toby109tt_statue.png", }, + use_texture_alpha = "clip", visual_scale = 0.5, wield_scale = {x=1.0, y=1.0, z=1.0}, paramtype = "light", @@ -948,6 +961,7 @@ minetest.register_node("decoblocks:GreenXenith_Statue", { tiles = { "decoblocks_GreenXenith_statue.png", }, + use_texture_alpha = "clip", visual_scale = 0.5, wield_scale = {x=1.0, y=1.0, z=1.0}, paramtype = "light", @@ -971,6 +985,7 @@ minetest.register_node("decoblocks:DS_Minetest_Statue", { tiles = { "decoblocks_DS_Minetest_statue.png", }, + use_texture_alpha = "clip", visual_scale = 0.5, wield_scale = {x=1.0, y=1.0, z=1.0}, paramtype = "light", @@ -1207,6 +1222,7 @@ minetest.register_node("decoblocks:bear_rug", { tiles = { "mobs_bear.png", }, + use_texture_alpha = "opaque", visual_scale = 0.5, wield_scale = {x=0.5, y=0.5, z=0.5}, paramtype = "light", @@ -1231,6 +1247,7 @@ minetest.register_node("decoblocks:polar_bear_rug", { tiles = { "mobs_polar_bear.png", }, + use_texture_alpha = "opaque", visual_scale = 0.5, wield_scale = {x=0.5, y=0.5, z=0.5}, paramtype = "light", @@ -1314,14 +1331,14 @@ minetest.register_node("decoblocks:"..colour.."_glass", { description = ""..desc.." Stained Glass", drawtype = "glasslike", tiles = {"decoblocks_"..colour.."_glass.png"}, - use_texture_alpha = true, + use_texture_alpha = "blend", sounds = default.node_sound_glass_defaults(), groups = {cracky=1, oddly_breakable_by_hand=3, snappy=2} }) xpanes.register_pane(""..colour.."_glass", { description = ""..desc.." Stained Glass Pane", textures = {"decoblocks_"..colour.."_glass.png","decoblocks_"..colour.."_glass.png","decoblocks_"..colour.."_glass.png"}, - use_texture_alpha = true, + use_texture_alpha = "blend", inventory_image = "decoblocks_"..colour.."_glass.png", wield_image = "decoblocks_"..colour.."_glass.png", sounds = default.node_sound_glass_defaults(), @@ -1331,4 +1348,4 @@ xpanes.register_pane(""..colour.."_glass", { {"", "xpanes:pane", ""} } }) -end \ No newline at end of file +end diff --git a/mods/default/craftitems.lua b/mods/default/craftitems.lua index c63d546..d21f136 100644 --- a/mods/default/craftitems.lua +++ b/mods/default/craftitems.lua @@ -112,7 +112,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) if inv:room_for_item("main", new_stack) then inv:add_item("main", new_stack) else - minetest.add_item(player:getpos(), new_stack) + minetest.add_item(player:get_pos(), new_stack) end else stack:get_meta():from_table({ fields = data }) @@ -238,7 +238,7 @@ minetest.register_craftitem("default:skeleton_key", { itemstack = new_stack else if inv:add_item("main", new_stack):get_count() > 0 then - minetest.add_item(user:getpos(), new_stack) + minetest.add_item(user:get_pos(), new_stack) end -- else: added to inventory successfully end diff --git a/mods/default/item_entity.lua b/mods/default/item_entity.lua index c34e60e..c43d278 100644 --- a/mods/default/item_entity.lua +++ b/mods/default/item_entity.lua @@ -16,7 +16,7 @@ local item = { burn_up = function(self) -- disappear in a smoke puff self.object:remove() - local p = self.object:getpos() + local p = self.object:get_pos() minetest.sound_play("default_item_smoke", { pos = p, max_hear_distance = 8, @@ -39,8 +39,8 @@ local item = { }) end, - on_step = function(self, dtime) - builtin_item.on_step(self, dtime) + on_step = function(self, dtime, moveresult) + builtin_item.on_step(self, dtime, moveresult) if self.flammable then -- flammable, check for igniters @@ -48,7 +48,7 @@ local item = { if self.ignite_timer > 10 then self.ignite_timer = 0 - local node = minetest.get_node_or_nil(self.object:getpos()) + local node = minetest.get_node_or_nil(self.object:get_pos()) if not node then return end diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index e0a3547..dd6ac9a 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -1121,6 +1121,7 @@ minetest.register_node("default:cactus", { tiles = { "default_cactus.png", }, + use_texture_alpha = "clip", visual_scale = 0.5, groups = {choppy = 3}, sounds = default.node_sound_wood_defaults(), @@ -1472,7 +1473,7 @@ minetest.register_node("default:water_source", { drawtype = "liquid", tiles = { { - name = "default_water_source_animated.png", + name = "default_water_source_animated.png^[opacity:200", animation = { type = "vertical_frames", aspect_w = 16, @@ -1481,20 +1482,21 @@ minetest.register_node("default:water_source", { }, }, }, - special_tiles = { - -- New-style water source material (mostly unused) - { - name = "default_water_source_animated.png", - animation = { - type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, - length = 2.0, - }, - backface_culling = false, - }, - }, - alpha = 160, + -- special_tiles = { + -- -- New-style water source material (mostly unused) + -- { + -- name = "default_water_source_animated.png", + -- animation = { + -- type = "vertical_frames", + -- aspect_w = 16, + -- aspect_h = 16, + -- length = 2.0, + -- }, + -- backface_culling = false, + -- }, + -- }, + -- alpha = 160, + use_texture_alpha = "blend", paramtype = "light", walkable = false, pointable = false, @@ -1515,10 +1517,10 @@ minetest.register_node("default:water_source", { minetest.register_node("default:water_flowing", { description = "Flowing Water", drawtype = "flowingliquid", - tiles = {"default_water.png"}, + -- tiles = {"default_water.png"}, special_tiles = { { - name = "default_water_flowing_animated.png", + name = "default_water_flowing_animated.png^[opacity:200", backface_culling = false, animation = { type = "vertical_frames", @@ -1528,7 +1530,7 @@ minetest.register_node("default:water_flowing", { }, }, { - name = "default_water_flowing_animated.png", + name = "default_water_flowing_animated.png^[opacity:200", backface_culling = true, animation = { type = "vertical_frames", @@ -1538,7 +1540,8 @@ minetest.register_node("default:water_flowing", { }, }, }, - alpha = 160, + -- alpha = 160, + use_texture_alpha = "blend", paramtype = "light", paramtype2 = "flowingliquid", walkable = false, @@ -1564,7 +1567,7 @@ minetest.register_node("default:river_water_source", { drawtype = "liquid", tiles = { { - name = "default_river_water_source_animated.png", + name = "default_river_water_source_animated.png^[opacity:200", animation = { type = "vertical_frames", aspect_w = 16, @@ -1573,19 +1576,20 @@ minetest.register_node("default:river_water_source", { }, }, }, - special_tiles = { - { - name = "default_river_water_source_animated.png", - animation = { - type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, - length = 2.0, - }, - backface_culling = false, - }, - }, - alpha = 160, + -- special_tiles = { + -- { + -- name = "default_river_water_source_animated.png", + -- animation = { + -- type = "vertical_frames", + -- aspect_w = 16, + -- aspect_h = 16, + -- length = 2.0, + -- }, + -- backface_culling = false, + -- }, + -- }, + -- alpha = 160, + use_texture_alpha = "blend", paramtype = "light", walkable = false, pointable = false, @@ -1608,10 +1612,10 @@ minetest.register_node("default:river_water_source", { minetest.register_node("default:river_water_flowing", { description = "Flowing River Water", drawtype = "flowingliquid", - tiles = {"default_river_water.png"}, + -- tiles = {"default_river_water.png"}, special_tiles = { { - name = "default_river_water_flowing_animated.png", + name = "default_river_water_flowing_animated.png^[opacity:200", backface_culling = false, animation = { type = "vertical_frames", @@ -1621,7 +1625,7 @@ minetest.register_node("default:river_water_flowing", { }, }, { - name = "default_river_water_flowing_animated.png", + name = "default_river_water_flowing_animated.png^[opacity:200", backface_culling = true, animation = { type = "vertical_frames", @@ -1631,7 +1635,8 @@ minetest.register_node("default:river_water_flowing", { }, }, }, - alpha = 160, + -- alpha = 160, + use_texture_alpha = "blend", paramtype = "light", paramtype2 = "flowingliquid", walkable = false, @@ -2134,6 +2139,7 @@ local function register_sign(material, desc, def) description = desc .. " Sign", drawtype = "nodebox", tiles = {"default_sign_wall_" .. material .. ".png"}, + use_texture_alpha = "opaque", inventory_image = "default_sign_" .. material .. ".png", wield_image = "default_sign_" .. material .. ".png", paramtype = "light", @@ -2282,6 +2288,7 @@ minetest.register_node("default:glass", { description = "Glass", drawtype = "glasslike_framed_optional", tiles = {"default_glass.png", "default_glass_detail.png"}, + use_texture_alpha = "clip", paramtype = "light", paramtype2 = "glasslikeliquidlevel", sunlight_propagates = true, @@ -2294,6 +2301,7 @@ minetest.register_node("default:obsidian_glass", { description = "Obsidian Glass", drawtype = "glasslike_framed_optional", tiles = {"default_obsidian_glass.png", "default_obsidian_glass_detail.png"}, + use_texture_alpha = "clip", paramtype = "light", paramtype2 = "glasslikeliquidlevel", is_ground_content = false, diff --git a/mods/default/player.lua b/mods/default/player.lua index 351be9b..2bdac1f 100644 --- a/mods/default/player.lua +++ b/mods/default/player.lua @@ -97,12 +97,13 @@ minetest.register_on_joinplayer(function(player) player:set_local_animation({x=0, y=79}, {x=168, y=187}, {x=189, y=198}, {x=200, y=219}, 30) -- set GUI - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then player:set_inventory_formspec(default.gui_survival_form) end - player:hud_set_hotbar_image("gui_hotbar.png") - player:hud_set_hotbar_selected_image("gui_hotbar_selected.png") + -- is overriden in the 'hud' mod + -- player:hud_set_hotbar_image("gui_hotbar.png") + -- player:hud_set_hotbar_selected_image("gui_hotbar_selected.png") end) minetest.register_on_leaveplayer(function(player) diff --git a/mods/default/textures/default_river_water_flowing_animated.png b/mods/default/textures/default_river_water_flowing_animated.png index 6bf585b6ecdf376e6ba3dbcf2d237c4158476590..beb59dbf000cfb8c9ab22dc261df1c82fdf1ec5f 100644 GIT binary patch delta 297 zcmV+^0oMM-2Dk!{7=Ho-0001RqYK>t000S4OjJb_VT%}ZrAV#h4H_@=0002$Nkl+p9AQ_f5Ve7vmH|mg zJ|zQ@`HL?%{3n)OiP!o?avUTd6|My1K;RSf1oW8$tV?lnCs`+9r+d~GeovZDuW97=H)`0000D&Erl0000JJOGiWiWdHyGD4ithxBvhE32;bRa{vGf z6951U69E94oEQKA00(qQO+^Rc2n!Y-BJVd3z5oCM(n&-?RA}DqS+Pn4K@5$#DYURT zEaX72v^=m;8(V+FFSx?b@H;I12pemE;W$~Y+U5kCMJ!~-On)}X8u{$fnlzmO(gm6Uxq<0#3ZfbeeFtee`?djJEV)b4phV*F-NT}~p3HFbtLssmRKhhC z=|U=m3rsC6;BV*8NdpgRD1JoxQuG86KVlUJd@()0g?~nFNVCG)1!)=@mH#a_NzrLS znw3PTpz1DIh}1%*CL*;^DOp)ZO=m ze6F~0=)2;o^=esZv|cR%4-ShPt2yhsYGIw{hQ5Qz{@LY)6gX59NxRC8R?tY=H4#aI zE)|h1@PCk!Y!i_rP%$A*dK=9Lt-wl>yENBHLPqt0WH_tnD!I|Zh3pZ@KG@nU`JdJi z$ZH=@ZlK_b+aeJMSKI}KsBzJ{^KML((wj%Cq3^~ulBY+gLYcaV8>t0n

rcY4@aR zI9l$KwEKBP(!$$?NM1BjYb0)YHzH|OnuSQCNPm>BtOaYxGmWIK)k9Q>)an(*YGoTx zl??q~K($p=yCKbsMk=IjTVxG=7e&_JD6(9TW~K0EmA30=uxLDgUE?V=l~xp1ji;6a zE!R>+O5DQqS<_}z;>3rjANUZ(;mi6El{|ex@C(5&1iujcLhuX0FGQIa{6g>x(fS6z z5HtKj@C(5&1iujcLhuX0FGP_Q{6g>x!7l{A5c~oepI2y>_|Vy`sfLk?~+Ii>gJ{QDRfm@av`IEG~0dmFjYi^Y+rcclw>zSDln&K4vGM@Ucwg>DYeQ z$82&++@#uS_wC=g6O?_^85j)q@6s#QKkvWTlA+J@1K1vO_cO2j-Mybd11{u zIqzF8y7R7HRVw^cR#ca`^Y!CeX8HHh2b!H37$VkB+YqPw@W+!cw>$1!x)Km#AUe;~ z>21!e_dDB88eKU3S$K<*=*vfc(p?q#w=LP(&9z91ri0Irc%7Zzmln7@`gr&7 zqFwXO6ntL&I&eW<_RhiPL4|=j)bUZTWgvR^r^}ZTp%} z{=50KRm37h*mL)(-mnWEw@d{+oAg8{>U@|mDMxssN`RrFZKEqKs%TS<^T{0?jDio%P#KIi#Nxis5- z^}_eZOeZaOU*R-!SBLaU*7TYo$k+9z7)0lOy2f29NIrJs+a$3lvBke2Xe+V3X zc>0&XRGV7I58Ma!S@sM3aRM=1W{QIt7k{zAL=aLFMImZHB21F=!!xG+xNvjnL12Ps N@O1TaS?83{1OQ8Yc1r*N literal 0 HcmV?d00001 diff --git a/mods/default/textures/default_water_flowing_animated.png b/mods/default/textures/default_water_flowing_animated.png index d2c6c9c8ec905944c90fbc8db8f6382c023b92c9..a824433caec27bd4a6cb92a9163aaba72a48936a 100644 GIT binary patch delta 297 zcmV+^0oMM;2Dk!{7=Ho-0001RqYK>t000S4OjJc5MU5?1rABzp;a>|>0002$Nkl+p9AQ_f5Ve7vmH|mg zJ|zQ@`HL?%{3n)OiP!o?avUTd6|My1K;RSf1oW8$tV?lnCs`+9r+d~GeovZD%cA7=H)`0000D&Erl0000JJOGiWiWdHyGD4ithxBvhE32;bRa{vGf z6951U69E94oEQKA00(qQO+^Rc2n!Y-8?Z8mwg3PE(@8`@RA}DqSusv5F%0#Fh%K0Y zzl4w|Xc66tl7E1I77oEJIL+4E?G3isBK=Sd2#Mk=gU9picz;(y0^~?&nJ94_`{mh* z7gv9u9!a!iw<02Vm3YW4tIG)xNOBUlcvV+J;@Mkw zdvCex{q=?3Uw>aHpLaw=R1SM8hduqdy#6$zv@|yq7tDoMjgsav&G%BnZ25h+-B1gu zi4U%S778WUvIZJ1h-)zPg_hmw(*|-dau?E|j#=FNdw%4rNW);5Hg3UUB<-Bk?*+Oy z%2iMX_w|gV!P~`1UN%y5Bx!j!BWYQh#Yi(GqJJZ6(OQy`2B~Y^AtsE}y6VHr_c5f3 z4EI+d{i26d*7b3}u`a;wfqP`IIg{UvE_5qJhgOxHC2zCGf002ovPDHLk FV1mHWeFp#l diff --git a/mods/default/textures/default_water_flowing_animated_alpha.png b/mods/default/textures/default_water_flowing_animated_alpha.png new file mode 100644 index 0000000000000000000000000000000000000000..7da954f083e340170590ae65e6abfcb4093e7467 GIT binary patch literal 780 zcmV+n1M~ceP)Q*@+idf1e&nv}LypfBlts$SteO2@ptf z61R9&S3~02TX%bJx$FJ)h2CFZD4%ykL{tuYDu+G&xxD@~qO>$O6c@~eSB;Y9GR^l= z!)*C|x7|<+sfiD+e-;WQ*s=y1E{JO|^o5q)>eB{tFme~tppIGG{Cj@nt4PD$tsiDM z;li_~qC_9pj0?;yF3_NDGLkfu+#+8zc>pB0IKhD&%=d4xk(<&iSi2}qW25?;TW&(= zG${?m0g2Atb~8N-79+J-smVw!R?1e?(a3~rl)RHQdP~-E^$1GbuhPe!riM0481G9G zINZlbi0m8PIP_(7RXOY@8kNJI@_9G9k@qF*xN5MjeM4X9?Ba5LkATB9LE25+Xn_W4 z*JLC_T`D74}rc+pm8#h^J-pz?9ym_=5`ZCXvJa>c%l(~zfky>;%Zoy(C z?VQx_1-duNRZs@^^^By!+r>y;Hd1pWX?ZszX<3@ZNHZj&BWuxGl92|fYuzCxjMTd7 z!^`(Eq>2pvTS&E)RJ$q7%SI}t9h+ngeTgLNXCzrJO0z 0 and 24 * 60 * 60 / time_speed) or 0 --nil local function clamp(x, min, max) @@ -373,6 +373,7 @@ function farming.plant_growth_timer(pos, elapsed, node_name) if growth < 1 then return true end end + assert(type(stages.stages_left[growth]) == "string", node_name .. " can't grow to stage: " .. growth ) minetest.swap_node(pos, { name = stages.stages_left[growth] }) return growth ~= max_growth @@ -459,7 +460,7 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname) -- if not protected then add node and remove 1 item from the itemstack if not minetest.is_protected(pt.above, placer:get_player_name()) then minetest.set_node(pt.above, {name = plantname, param2 = 1}) - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then itemstack:take_item() -- check for refill if itemstack:get_count() == 0 diff --git a/mods/farming/melon.lua b/mods/farming/melon.lua index 19c1548..ea9f798 100644 --- a/mods/farming/melon.lua +++ b/mods/farming/melon.lua @@ -50,6 +50,7 @@ minetest.register_node("farming:melon_3", { "farming_melon_3_top.png", "farming_melon_3.png", }, + use_texture_alpha = "clip", drawtype = "nodebox", paramtype = "light", node_box = { @@ -84,6 +85,7 @@ minetest.register_node("farming:melon_4", { "farming_melon_4_top.png", "farming_melon_4.png", }, + use_texture_alpha = "clip", drawtype = "nodebox", paramtype = "light", node_box = { diff --git a/mods/farming/pumpkin.lua b/mods/farming/pumpkin.lua index 2e334ad..f85fbce 100644 --- a/mods/farming/pumpkin.lua +++ b/mods/farming/pumpkin.lua @@ -50,6 +50,7 @@ minetest.register_node("farming:pumpkin_3", { "farming_pumpkin_3_top.png", "farming_pumpkin_3.png", }, + use_texture_alpha = "clip", drawtype = "nodebox", paramtype = "light", node_box = { @@ -84,6 +85,7 @@ minetest.register_node("farming:pumpkin_4", { "farming_pumpkin_4_top.png", "farming_pumpkin_4.png", }, + use_texture_alpha = "clip", drawtype = "nodebox", paramtype = "light", node_box = { @@ -355,4 +357,4 @@ minetest.register_node("farming:cut_pumpkin_5", { minetest.remove_node(pos) clicker:set_hp(clicker:get_hp()+1) end, -}) \ No newline at end of file +}) diff --git a/mods/fire/init.lua b/mods/fire/init.lua index a8423f7..95ad6c7 100644 --- a/mods/fire/init.lua +++ b/mods/fire/init.lua @@ -115,7 +115,7 @@ minetest.register_tool("fire:flint_and_steel", { minetest.set_node(pt.above, {name = "fire:basic_flame"}) end end - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then -- Wear tool local wdef = itemstack:get_definition() itemstack:add_wear(1000) @@ -159,7 +159,7 @@ minetest.override_item("default:coalblock", { -- 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 @@ -180,7 +180,7 @@ if flame_sound then function fire.update_player_sound(player) local player_name = player:get_player_name() -- Search for flame nodes in radius around player - local ppos = player:getpos() + local ppos = player:get_pos() local areamin = vector.subtract(ppos, radius) local areamax = vector.add(ppos, radius) local fpos, num = minetest.find_nodes_in_area( @@ -301,11 +301,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 diff --git a/mods/fireworks/init.lua b/mods/fireworks/init.lua index 1bbb077..6e614ba 100644 --- a/mods/fireworks/init.lua +++ b/mods/fireworks/init.lua @@ -15,7 +15,7 @@ minetest.register_entity("fireworks:dummy_entity", { for i=1,2 do minetest.after(i/10, function() if self.object ~= nil then - local pos = self.object:getpos() + local pos = self.object:get_pos() if pos == nil then return end minetest.add_particle({ @@ -48,7 +48,7 @@ minetest.register_entity("fireworks:firework_"..number.."_rocket", { on_activate = function(self) minetest.after(3, function() local pos = self.object:get_pos() - local velo = self.object:getvelocity() + local velo = self.object:get_velocity() if pos == nil or velo == nil then return end @@ -130,7 +130,7 @@ minetest.register_entity("fireworks:firework_"..number.."_rocket", { on_activate = function(self) minetest.after(3, function() local pos = self.object:get_pos() - local velo = self.object:getvelocity() + local velo = self.object:get_velocity() if pos == nil or velo == nil then return end @@ -155,14 +155,14 @@ minetest.register_entity("fireworks:firework_"..number.."_rocket", { local spark = minetest.add_entity(pos, "fireworks:dummy_entity") local spark_thing = spark:get_luaentity() spark_thing.texture = tex1 - spark:setvelocity({x=math.random(-1,1)*3, y=math.random(-1,1)*3, z=math.random(-1,1)*3}) - spark:setacceleration({x=math.random(-1,1)*3, y=math.random(-4,-4), z=math.random(-1,1)*3}) + spark:set_velocity({x=math.random(-1,1)*3, y=math.random(-1,1)*3, z=math.random(-1,1)*3}) + spark:set_acceleration({x=math.random(-1,1)*3, y=math.random(-4,-4), z=math.random(-1,1)*3}) elseif shape == "scatter" then local spark = minetest.add_entity(pos, "fireworks:dummy_entity") local spark_thing = spark:get_luaentity() spark_thing.texture = tex1 - spark:setvelocity({x=math.random(-4,4), y=math.random(-4,4), z=math.random(-4,4)}) - spark:setacceleration({x=math.random(-4,4), y=math.random(-4,-4), z=math.random(-4,4)}) + spark:set_velocity({x=math.random(-4,4), y=math.random(-4,4), z=math.random(-4,4)}) + spark:set_acceleration({x=math.random(-4,4), y=math.random(-4,-4), z=math.random(-4,4)}) minetest.add_particle({ pos = {x=pos.x, y=pos.y, z=pos.z}, velocity = {x=math.random(-2,2), y=math.random(5,9), z=math.random(-2,2)}, @@ -195,7 +195,7 @@ minetest.register_entity("fireworks:firework_"..number.."_rocket", { on_activate = function(self) minetest.after(3, function() local pos = self.object:get_pos() - local velo = self.object:getvelocity() + local velo = self.object:get_velocity() if pos == nil or velo == nil then return end @@ -272,18 +272,18 @@ minetest.register_tool("fireworks:gun", { if number == nil then return item end - local pos = placer:getpos() + local pos = placer:get_pos() if pointed_thing ~= nil then local dir = placer:get_look_dir() local obj = minetest.env:add_entity({x=pos.x+dir.x, y=pos.y+dir.y+0.5, z=pos.z+dir.z}, "fireworks:firework_"..number.."_rocket") minetest.sound_play("firework_whistle", {pos = pos, gain = 0.2, max_hear_distance = 15}) - obj:setvelocity({x=dir.x*15, y=dir.y*20, z=dir.z*15}) - obj:setacceleration({x=dir.x*2, y=-2, z=dir.z*2}) + obj:set_velocity({x=dir.x*15, y=dir.y*20, z=dir.z*15}) + obj:set_acceleration({x=dir.x*2, y=-2, z=dir.z*2}) local rocket = obj:get_luaentity() for i=1,23 do minetest.after(i/9, function() local pos = rocket.object:get_pos() - local velo = rocket.object:getvelocity() + local velo = rocket.object:get_velocity() if pos == nil or velo == nil then return item end @@ -310,13 +310,13 @@ function firework_launch(pos, name) minetest.remove_node(pos) local obj = minetest.env:add_entity({x=pos.x, y=pos.y, z=pos.z}, name.."_rocket") minetest.sound_play("firework_whistle", {pos = pos, gain = 0.2, max_hear_distance = 15}) - obj:setvelocity({x=0, y=15, z=0}) - obj:setacceleration({x=0, y=2, z=0}) + obj:set_velocity({x=0, y=15, z=0}) + obj:set_acceleration({x=0, y=2, z=0}) local rocket = obj:get_luaentity() for i=1,23 do minetest.after(i/9, function() local pos = rocket.object:get_pos() - local velo = rocket.object:getvelocity() + local velo = rocket.object:get_velocity() if pos == nil or velo == nil then return end @@ -343,6 +343,7 @@ minetest.register_node("fireworks:firework_1", { drawtype = "mesh", mesh = "firework_rocket2.b3d", tiles = {"firework_rocket.png"}, + use_texture_alpha = "opaque", paramtype = "light", collision_box = { type = "fixed", @@ -367,6 +368,7 @@ minetest.register_node("fireworks:firework_2", { drawtype = "mesh", mesh = "firework_rocket2.b3d", tiles = {"firework_rocket.png"}, + use_texture_alpha = "opaque", paramtype = "light", collision_box = { type = "fixed", @@ -391,6 +393,7 @@ minetest.register_node("fireworks:firework_3", { drawtype = "mesh", mesh = "firework_rocket2.b3d", tiles = {"firework_rocket.png"}, + use_texture_alpha = "opaque", paramtype = "light", collision_box = { type = "fixed", @@ -415,6 +418,7 @@ minetest.register_node("fireworks:firework_4", { drawtype = "mesh", mesh = "firework_rocket2.b3d", tiles = {"firework_rocket.png"}, + use_texture_alpha = "opaque", paramtype = "light", collision_box = { type = "fixed", @@ -439,6 +443,7 @@ minetest.register_node("fireworks:firework_5", { drawtype = "mesh", mesh = "firework_rocket2.b3d", tiles = {"firework_rocket.png"}, + use_texture_alpha = "opaque", paramtype = "light", collision_box = { type = "fixed", @@ -463,6 +468,7 @@ minetest.register_node("fireworks:firework_6", { drawtype = "mesh", mesh = "firework_rocket2.b3d", tiles = {"firework_rocket.png"}, + use_texture_alpha = "opaque", paramtype = "light", collision_box = { type = "fixed", @@ -487,6 +493,7 @@ minetest.register_node("fireworks:firework_7", { drawtype = "mesh", mesh = "firework_rocket2.b3d", tiles = {"firework_rocket.png"}, + use_texture_alpha = "opaque", paramtype = "light", collision_box = { type = "fixed", @@ -511,6 +518,7 @@ minetest.register_node("fireworks:firework_8", { drawtype = "mesh", mesh = "firework_rocket2.b3d", tiles = {"firework_rocket.png"}, + use_texture_alpha = "opaque", paramtype = "light", collision_box = { type = "fixed", @@ -535,6 +543,7 @@ minetest.register_node("fireworks:firework_9", { drawtype = "mesh", mesh = "firework_rocket2.b3d", tiles = {"firework_rocket.png"}, + use_texture_alpha = "opaque", paramtype = "light", collision_box = { type = "fixed", @@ -551,4 +560,4 @@ minetest.register_node("fireworks:firework_9", { firework_launch(pos, "fireworks:firework_9") end end -}) \ No newline at end of file +}) diff --git a/mods/flowerpots/nodes.lua b/mods/flowerpots/nodes.lua index acf8186..2c9d12d 100644 --- a/mods/flowerpots/nodes.lua +++ b/mods/flowerpots/nodes.lua @@ -62,6 +62,7 @@ minetest.register_node("flowerpots:flower_pot", { tiles = { "flowerpot.png", }, + use_texture_alpha = "clip", visual_scale = 0.5, wield_scale = {x=1.0, y=1.0, z=1.0}, paramtype = "light", @@ -82,7 +83,7 @@ minetest.register_node("flowerpots:flower_pot", { local flower_node = row[2] if item == flower_node then minetest.set_node(pos, {name="flowerpots:flower_pot_"..flower}) - if not minetest.setting_getbool("creative") then + if not minetest.settings:get_bool("creative") then itemstack:take_item() end end @@ -92,7 +93,7 @@ minetest.register_node("flowerpots:flower_pot", { local flower_node = row[2] if item == flower_node then minetest.set_node(pos, {name="flowerpots:flower_pot_"..flower}) - if not minetest.setting_getbool("creative") then + if not minetest.settings:get_bool("creative") then itemstack:take_item() end end @@ -121,6 +122,7 @@ minetest.register_node("flowerpots:flower_pot_"..flower, { tiles = { "[combine:32x32:0,0=flowerpot.png:0,0="..texture[1], }, + use_texture_alpha = "clip", visual_scale = 0.5, wield_scale = {x=1.0, y=1.0, z=1.0}, paramtype = "light", @@ -155,6 +157,7 @@ minetest.register_node("flowerpots:flower_pot_"..flower, { tiles = { "flowerpot_"..flower..".png", }, + use_texture_alpha = "clip", visual_scale = 0.5, wield_scale = {x=1.0, y=1.0, z=1.0}, paramtype = "light", @@ -176,4 +179,4 @@ minetest.register_node("flowerpots:flower_pot_"..flower, { max_items = 2,items = {{items = {"flowerpots:flower_pot", flower_node},rarity = 1,},}, }, }) -end \ No newline at end of file +end diff --git a/mods/flowers/init.lua b/mods/flowers/init.lua index a103403..baebec6 100644 --- a/mods/flowers/init.lua +++ b/mods/flowers/init.lua @@ -252,6 +252,7 @@ minetest.register_node("flowers:waterlily", { paramtype = "light", paramtype2 = "facedir", tiles = {"flowers_waterlily.png", "flowers_waterlily_bottom.png"}, + use_texture_alpha = "clip", inventory_image = "flowers_waterlily.png", wield_image = "flowers_waterlily.png", liquids_pointable = true, @@ -282,7 +283,7 @@ minetest.register_node("flowers:waterlily", { if not minetest.is_protected(pos, player_name) then minetest.set_node(pos, {name = "flowers:waterlily", param2 = math.random(0, 3)}) - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then itemstack:take_item() end else diff --git a/mods/flowers_plus/init.lua b/mods/flowers_plus/init.lua index 6e17712..6e7684c 100644 --- a/mods/flowers_plus/init.lua +++ b/mods/flowers_plus/init.lua @@ -50,7 +50,7 @@ minetest.register_node("flowers_plus:foxglove", { tiles = {"flowers_foxglove_pink.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, inventory_image = "flowers_foxglove_pink.png", visual_scale = 2, @@ -70,7 +70,7 @@ minetest.register_node("flowers_plus:foxglove_purple", { tiles = {"flowers_foxglove_purple.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, inventory_image = "flowers_foxglove_purple.png", visual_scale = 2, @@ -92,6 +92,7 @@ minetest.register_node("flowers_plus:red_ground_flower", { tiles = { "flowers_red_ground_flower.png", }, + use_texture_alpha = "clip", node_box = { type = "fixed", fixed = { @@ -111,6 +112,7 @@ minetest.register_node("flowers_plus:pink_ground_flower", { tiles = { "flowers_pink_ground_flower.png", }, + use_texture_alpha = "clip", node_box = { type = "fixed", fixed = { @@ -130,6 +132,7 @@ minetest.register_node("flowers_plus:blue_ground_flower", { tiles = { "flowers_blue_ground_flower.png", }, + use_texture_alpha = "clip", node_box = { type = "fixed", fixed = { @@ -208,4 +211,4 @@ minetest.register_decoration({ decoration = "flowers_plus:frozen_rose", height = 1, }) -end \ No newline at end of file +end diff --git a/mods/give_initial_stuff/init.lua b/mods/give_initial_stuff/init.lua index 40798e8..d813af5 100644 --- a/mods/give_initial_stuff/init.lua +++ b/mods/give_initial_stuff/init.lua @@ -1,4 +1,4 @@ -local stuff_string = minetest.setting_get("initial_stuff") or +local stuff_string = minetest.settings:get("initial_stuff") or "" give_initial_stuff = { @@ -38,6 +38,6 @@ function give_initial_stuff.get_list() end give_initial_stuff.add_from_csv(stuff_string) -if minetest.setting_getbool("give_initial_stuff") then +if minetest.settings:get_bool("give_initial_stuff") then minetest.register_on_newplayer(give_initial_stuff.give) end diff --git a/mods/hud_hunger/hud/builtin.lua b/mods/hud_hunger/hud/builtin.lua index ba89816..49d34c3 100644 --- a/mods/hud_hunger/hud/builtin.lua +++ b/mods/hud_hunger/hud/builtin.lua @@ -17,7 +17,7 @@ HUD_ARMOR_POS = {x = 0.5, y = 1} HUD_ARMOR_OFFSET = {x = -262, y = -110} -- Reorder everything when using ItemWeel -hud.item_wheel = minetest.setting_getbool("hud_item_wheel") +hud.item_wheel = minetest.settings:get_bool("hud_item_wheel") if hud.item_wheel then HUD_HEALTH_POS = {x = 0.5,y = 1} HUD_HEALTH_OFFSET = {x = -385, y = -77} @@ -41,14 +41,14 @@ end hud.read_conf() -local damage_enabled = minetest.setting_getbool("enable_damage") +local damage_enabled = minetest.settings:get_bool("enable_damage") hud.show_hunger = minetest.get_modpath("hunger") ~= nil hud.show_armor = minetest.get_modpath("3d_armor") ~= nil -- check if some settings are invalid -local enable_hunger = minetest.setting_getbool("hud_hunger_enable") -if (enable_hunger == true or HUD_ENABLE_HUNGER == true) and not hud.show_hunger then +local enable_hunger = minetest.settings:get_bool("hud_hunger_enable") +if (enable_hunger == true) and not hud.show_hunger then hud.notify_hunger(5) end diff --git a/mods/hud_hunger/hunger/functions.lua b/mods/hud_hunger/hunger/functions.lua index ab3b711..759d63a 100644 --- a/mods/hud_hunger/hunger/functions.lua +++ b/mods/hud_hunger/hunger/functions.lua @@ -40,7 +40,7 @@ function hunger.update_hunger(player, new_lvl) if not name then return false end - if minetest.setting_getbool("enable_damage") == false then + if minetest.settings:get_bool("enable_damage") == false then hunger.players[name] = 20 return end @@ -102,8 +102,8 @@ function hunger.handle_node_actions(pos, oldnode, player, ext) end -- sprint settings -local enable_sprint = minetest.setting_getbool("sprint") ~= false -local enable_sprint_particles = minetest.setting_getbool("sprint_particles") ~= false +local enable_sprint = minetest.settings:get_bool("sprint") ~= false +local enable_sprint_particles = minetest.settings:get_bool("sprint_particles") ~= false -- 3d armor support local armor_mod = minetest.get_modpath("3d_armor") @@ -186,7 +186,7 @@ local function hunger_globaltimer(dtime) -- create particles behind player when sprinting if enable_sprint_particles then - local pos = player:getpos() + local pos = player:get_pos() local node = minetest.get_node({ x = pos.x, y = pos.y - 1, @@ -269,7 +269,7 @@ local function hunger_globaltimer(dtime) end -if minetest.setting_getbool("enable_damage") then +if minetest.settings:get_bool("enable_damage") then minetest.register_globalstep(hunger_globaltimer) end @@ -374,7 +374,7 @@ function hunger.item_eat(hunger_change, replace_with_item, poisen, heal, sound) if inv:room_for_item("main", {name = replace_with_item}) then inv:add_item("main", replace_with_item) else - local pos = user:getpos() + local pos = user:get_pos() pos.y = math.floor(pos.y + 0.5) core.add_item(pos, replace_with_item) end diff --git a/mods/hud_hunger/hunger/functions_(nosprint).lua b/mods/hud_hunger/hunger/functions_(nosprint).lua index b473a4e..f0ecbf3 100644 --- a/mods/hud_hunger/hunger/functions_(nosprint).lua +++ b/mods/hud_hunger/hunger/functions_(nosprint).lua @@ -40,7 +40,7 @@ function hunger.update_hunger(player, new_lvl) if not name then return false end - if minetest.setting_getbool("enable_damage") == false then + if minetest.settings:get_bool("enable_damage") == false then hunger.players[name] = 20 return end @@ -163,7 +163,7 @@ local function hunger_globaltimer(dtime) end end -if minetest.setting_getbool("enable_damage") then +if minetest.settings:get_bool("enable_damage") then minetest.register_globalstep(hunger_globaltimer) end @@ -268,7 +268,7 @@ function hunger.item_eat(hunger_change, replace_with_item, poisen, heal, sound) if inv:room_for_item("main", {name = replace_with_item}) then inv:add_item("main", replace_with_item) else - local pos = user:getpos() + local pos = user:get_pos() pos.y = math.floor(pos.y + 0.5) core.add_item(pos, replace_with_item) end diff --git a/mods/hud_hunger/hunger/init.lua b/mods/hud_hunger/hunger/init.lua index b7485c7..a86d410 100644 --- a/mods/hud_hunger/hunger/init.lua +++ b/mods/hud_hunger/hunger/init.lua @@ -35,7 +35,7 @@ hud.save_hunger = hunger.save hud.load_hunger = hunger.load -- Callbacks -if minetest.setting_getbool("enable_damage") then +if minetest.settings:get_bool("enable_damage") then minetest.register_on_joinplayer(function(player) local inv = player:get_inventory() diff --git a/mods/hud_hunger/hunger/init_(nosprint).lua b/mods/hud_hunger/hunger/init_(nosprint).lua index a054676..7b68ca5 100644 --- a/mods/hud_hunger/hunger/init_(nosprint).lua +++ b/mods/hud_hunger/hunger/init_(nosprint).lua @@ -32,7 +32,7 @@ hud.save_hunger = hunger.save hud.load_hunger = hunger.load -- Callbacks -if minetest.setting_getbool("enable_damage") then +if minetest.settings:get_bool("enable_damage") then minetest.register_on_joinplayer(function(player) local inv = player:get_inventory() diff --git a/mods/item_drop/init.lua b/mods/item_drop/init.lua index 403efd8..392fd63 100644 --- a/mods/item_drop/init.lua +++ b/mods/item_drop/init.lua @@ -1,7 +1,7 @@ minetest.register_globalstep(function(dtime) for _,player in ipairs(minetest.get_connected_players()) do - if player:get_hp() > 0 or not minetest.setting_getbool("enable_damage") then - local pos = player:getpos() + if player:get_hp() > 0 or not minetest.settings:get_bool("enable_damage") then + local pos = player:get_pos() local inv = player:get_inventory() for _,object in ipairs(minetest.get_objects_inside_radius(pos, 0.75)) do @@ -23,12 +23,12 @@ minetest.register_globalstep(function(dtime) if inv and inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then local pos1 = pos pos1.y = pos1.y+0.2 - local pos2 = object:getpos() + local pos2 = object:get_pos() local vec = {x=pos1.x-pos2.x, y=pos1.y-pos2.y, z=pos1.z-pos2.z} vec.x = vec.x*3 vec.y = vec.y*3 vec.z = vec.z*3 - object:setvelocity(vec) + object:set_velocity(vec) object:get_luaentity().physical_state = false object:get_luaentity().object:set_properties({ physical = false @@ -47,7 +47,7 @@ minetest.register_globalstep(function(dtime) object:get_luaentity().itemstring = "" object:remove() else - object:setvelocity({x = 0,y = 0,z = 0}) + object:set_velocity({x = 0,y = 0,z = 0}) object:get_luaentity().physical_state = true object:get_luaentity().object:set_properties({ physical = true @@ -66,7 +66,7 @@ end) --[[ function minetest.handle_node_drops(pos, drops, digger) local inv - if minetest.setting_getbool("creative_mode") and digger and digger:is_player() then + if minetest.settings:get_bool("creative_mode") and digger and digger:is_player() then inv = digger:get_inventory() end for _,item in ipairs(drops) do @@ -91,11 +91,11 @@ function minetest.handle_node_drops(pos, drops, digger) if math.random(1,2) == 1 then z = -z end - obj:setvelocity({x=1/x, y=obj:getvelocity().y, z=1/z}) + obj:set_velocity({x=1/x, y=obj:get_velocity().y, z=1/z}) -- FIXME this doesnt work for deactiveted objects - if minetest.setting_get("remove_items") and tonumber(minetest.setting_get("remove_items")) then - minetest.after(tonumber(minetest.setting_get("remove_items")), function(obj) + if minetest.settings:get("remove_items") and tonumber(minetest.settings:get("remove_items")) then + minetest.after(tonumber(minetest.settings:get("remove_items")), function(obj) obj:remove() end, obj) end @@ -106,6 +106,6 @@ function minetest.handle_node_drops(pos, drops, digger) end --]] -if minetest.setting_getbool("log_mods") then +if minetest.settings:get_bool("log_mods") then minetest.log("action", "Carbone: [item_drop] loaded.") end diff --git a/mods/mapgen/mapgen.lua b/mods/mapgen/mapgen.lua index 7f4729d..7f95956 100644 --- a/mods/mapgen/mapgen.lua +++ b/mods/mapgen/mapgen.lua @@ -6,7 +6,7 @@ -- These first to avoid other ores in blobs --kelp stone - + minetest.register_ore({ ore_type = "blob", ore = "mapgen:stone_with_sea_grass", @@ -25,7 +25,7 @@ persist = 0.0 }, }) - + -- Clay -- This first to avoid clay in sand blobs @@ -47,7 +47,7 @@ persist = 0.0 }, }) - + -- Sand @@ -93,7 +93,7 @@ biomes = {"taiga", "snowy_grassland", "grassland", "coniferous_forest", "deciduous_forest", "savanna", "rainforest"} }) - + minetest.register_ore({ ore_type = "blob", ore = "mapgen:coarse_dirt", @@ -135,11 +135,11 @@ persist = 0.0 }, }) - - + + --swamp water - + minetest.register_ore({ ore_type = "blob", ore = "mapgen:dirty_water_source", @@ -158,9 +158,9 @@ persist = 0.0 }, }) - + --new stone - + minetest.register_ore({ ore_type = "blob", ore = "mapgen:limestone", @@ -179,7 +179,7 @@ persist = 0.0 }, }) - + minetest.register_ore({ ore_type = "blob", ore = "mapgen:granite_brown", @@ -198,7 +198,7 @@ persist = 0.0 }, }) - + minetest.register_ore({ ore_type = "blob", ore = "mapgen:granite", @@ -217,7 +217,7 @@ persist = 0.0 }, }) - + minetest.register_ore({ ore_type = "blob", ore = "mapgen:dry_dirt", @@ -238,7 +238,7 @@ }) --dirt with leaves - + --[[minetest.register_ore({ ore_type = "blob", ore = "mapgen:dirt_with_leafygrass", @@ -260,7 +260,7 @@ })]] --coarse dirt - + minetest.register_ore({ ore_type = "blob", ore = "mapgen:coarse_dirt", @@ -279,7 +279,7 @@ persist = 0.0 }, }) - + minetest.register_ore({ ore_type = "blob", ore = "mapgen:coarse_dirt", @@ -299,7 +299,7 @@ }, biomes = {"coniferous_forest_tall",} }) - + -- Scatter ores -- Coal @@ -360,7 +360,7 @@ }) --Tin - + minetest.register_ore({ ore_type = "scatter", ore = "mapgen:tin_ore", @@ -371,7 +371,7 @@ y_min = -1000, y_max = 1025, }) - + -- Iron minetest.register_ore({ @@ -571,9 +571,9 @@ y_max = -1024, }) ]] - + --fossils - + minetest.register_ore({ ore_type = "scatter", ore = "mapgen:stone_with_ammonite", @@ -584,7 +584,7 @@ y_min = 625, y_max = 31000, }) - + minetest.register_ore({ ore_type = "scatter", ore = "mapgen:stone_with_bone", @@ -595,7 +595,7 @@ y_min = 625, y_max = 31000, }) - + minetest.clear_registered_biomes() --Swamp @@ -615,8 +615,8 @@ y_max = 21000, heat_point = 40, humidity_point = 0, -}) - +}) + -- Icesheet minetest.register_biome({ @@ -804,7 +804,7 @@ }) --bamboo forest - + minetest.register_biome({ name = "bamboo_forest", --node_dust = "", @@ -908,8 +908,8 @@ heat_point = 45, humidity_point = 70, }) - - + + minetest.register_biome({ name = "coniferous_forest_tall", --node_dust = "", @@ -1012,7 +1012,7 @@ humidity_point = 70, }) - + minetest.register_biome({ name = "deciduous_forest_shore", --node_dust = "", @@ -1137,7 +1137,7 @@ humidity_point = 0, }) - + -- Cold desert --[[ minetest.register_biome({ @@ -1436,7 +1436,7 @@ end minetest.clear_registered_decorations() --bamboo - + minetest.register_decoration({ deco_type = "simple", place_on = "default:dirt_with_grass", @@ -1454,7 +1454,7 @@ end decoration = "mapgen:bamboo_small", height = 3, }) - + minetest.register_decoration({ deco_type = "simple", place_on = "default:dirt_with_grass", "mapgen:dirt_with_leafygrass", @@ -1471,7 +1471,7 @@ end decoration = "mapgen:bamboo_grass", height = 1, }) - + minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt_with_grass"}, @@ -1490,7 +1490,7 @@ end schematic = minetest.get_modpath("mapgen") .. "/schematics/bamboo1.mts", flags = "place_center_x, place_center_z", }) - + minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt_with_grass"}, @@ -1509,7 +1509,7 @@ end schematic = minetest.get_modpath("mapgen") .. "/schematics/bamboo2.mts", flags = "place_center_x, place_center_z", }) - + minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt_with_grass"}, @@ -1528,9 +1528,9 @@ end schematic = minetest.get_modpath("mapgen") .. "/schematics/bamboo5.mts", flags = "place_center_x, place_center_z", }) - + --stone - + minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt_with_grass"}, @@ -1548,7 +1548,7 @@ end y_max = 31000, schematic = minetest.get_modpath("mapgen") .. "/schematics/rocks/savanna_rock1.mts", flags = "place_center_x, place_center_z", - }) + }) minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt_with_grass"}, @@ -1566,7 +1566,7 @@ end y_max = 31000, schematic = minetest.get_modpath("mapgen") .. "/schematics/rocks/savanna_rock2.mts", flags = "place_center_x, place_center_z", - }) + }) minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt_with_grass"}, @@ -1584,8 +1584,8 @@ end y_max = 31000, schematic = minetest.get_modpath("mapgen") .. "/schematics/rocks/savanna_rock3.mts", flags = "place_center_x, place_center_z", - }) - + }) + minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt_with_grass"}, @@ -1603,7 +1603,7 @@ end y_max = 31000, schematic = minetest.get_modpath("mapgen") .. "/schematics/rocks/rock1.mts", flags = "place_center_x, place_center_z", - }) + }) minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt_with_grass"}, @@ -1621,7 +1621,7 @@ end y_max = 31000, schematic = minetest.get_modpath("mapgen") .. "/schematics/rocks/rock2.mts", flags = "place_center_x, place_center_z", - }) + }) minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt_with_grass"}, @@ -1639,8 +1639,8 @@ end y_max = 31000, schematic = minetest.get_modpath("mapgen") .. "/schematics/rocks/rock3.mts", flags = "place_center_x, place_center_z", - }) - + }) + minetest.register_decoration({ deco_type = "schematic", place_on = {"default:desert_sand"}, @@ -1658,7 +1658,7 @@ end y_max = 31000, schematic = minetest.get_modpath("mapgen") .. "/schematics/rocks/desert_rock1.mts", flags = "place_center_x, place_center_z", - }) + }) minetest.register_decoration({ deco_type = "schematic", place_on = {"default:desert_sand"}, @@ -1676,7 +1676,7 @@ end y_max = 31000, schematic = minetest.get_modpath("mapgen") .. "/schematics/rocks/desert_rock2.mts", flags = "place_center_x, place_center_z", - }) + }) minetest.register_decoration({ deco_type = "schematic", place_on = {"default:desert_sand"}, @@ -1694,10 +1694,10 @@ end y_max = 31000, schematic = minetest.get_modpath("mapgen") .. "/schematics/rocks/desert_rock3.mts", flags = "place_center_x, place_center_z", - }) - + }) + --deciduous_forest trees - + minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt_with_grass"}, @@ -1715,8 +1715,8 @@ end y_max = 31000, schematic = minetest.get_modpath("mapgen") .. "/schematics/deciduous_tree1.mts", flags = "place_center_x, place_center_z", - }) - + }) + minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt_with_grass"}, @@ -1735,7 +1735,7 @@ end schematic = minetest.get_modpath("mapgen") .. "/schematics/deciduous_tree2.mts", flags = "place_center_x, place_center_z", }) - + minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt_with_grass"}, @@ -1754,8 +1754,8 @@ end schematic = minetest.get_modpath("mapgen") .. "/schematics/deciduous_tree3.mts", flags = "place_center_x, place_center_z", }) - - + + -- Apple tree and log minetest.register_decoration({ @@ -1776,7 +1776,7 @@ end schematic = minetest.get_modpath("mapgen") .. "/schematics/oak.mts", flags = "place_center_x, place_center_z", }) - + minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt_with_grass"}, @@ -1935,7 +1935,7 @@ end schematic = minetest.get_modpath("default") .. "/schematics/pine_tree.mts", flags = "place_center_x, place_center_z", }) - + minetest.register_decoration({ deco_type = "schematic", place_on = {"mapgen:dirt_with_leafygrass"}, @@ -1954,7 +1954,7 @@ end schematic = minetest.get_modpath("default") .. "/schematics/pine_tree.mts", flags = "place_center_x, place_center_z", }) - + minetest.register_decoration({ deco_type = "schematic", place_on = {"mapgen:dirt_with_leafygrass", "mapgen:coarse_dirt"}, @@ -2008,7 +2008,7 @@ end }) --yellow ipe - + minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt_with_grass"}, @@ -2028,9 +2028,9 @@ end flags = "place_center_x, place_center_z", rotation = "random", }) - + --baobab tree - + minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt_with_dry_grass"}, @@ -2050,7 +2050,7 @@ end flags = "place_center_x, place_center_z", rotation = "random", }) - + minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt_with_dry_grass"}, @@ -2070,7 +2070,7 @@ end flags = "place_center_x, place_center_z", rotation = "random", }) - + minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt_with_dry_grass"}, @@ -2159,7 +2159,7 @@ minetest.register_decoration({ decoration = "mapgen:wild_oat", height = 1, }) - + -- Acacia tree and log minetest.register_decoration({ @@ -2233,7 +2233,7 @@ minetest.register_decoration({ flags = "place_center_x, place_center_z", }) ]] - + minetest.register_decoration({ deco_type = "schematic", place_on = {"mapgen:dirt_with_swampgrass"}, @@ -2252,7 +2252,7 @@ minetest.register_decoration({ schematic = minetest.get_modpath("mapgen") .. "/schematics/willow2.mts", flags = "place_center_x, place_center_z", }) - + -- Aspen tree and log minetest.register_decoration({ @@ -2370,9 +2370,9 @@ minetest.register_decoration({ y_max = 0, schematic = minetest.get_modpath("default") .. "/schematics/papyrus.mts", }) - + --tall grass - + minetest.register_decoration({ deco_type = "simple", place_on = "default:dirt_with_grass", "mapgen:dirt_with_leafygrass", "mapgen:dirt_with_swampgrass", @@ -2407,7 +2407,7 @@ minetest.register_decoration({ }) --shrubs - + minetest.register_decoration({ deco_type = "simple", place_on = "mapgen:dirt_with_leafygrass", @@ -2428,7 +2428,7 @@ minetest.register_decoration({ biomes = {"deciduous_forest2",}, decoration = "mapgen:creeper", height = 1, -}) +}) minetest.register_decoration({ deco_type = "simple", @@ -2438,7 +2438,7 @@ minetest.register_decoration({ biomes = {"deciduous_forest2",}, decoration = "mapgen:shrub2", height = 1, -}) +}) minetest.register_decoration({ deco_type = "simple", @@ -2448,7 +2448,7 @@ minetest.register_decoration({ biomes = {"deciduous_forest2",}, decoration = "mapgen:bush", height = 1, -}) +}) --ferns @@ -2461,7 +2461,7 @@ minetest.register_decoration({ decoration = "mapgen:fern", height = 1, }) - + minetest.register_decoration({ deco_type = "simple", place_on = "mapgen:dirt_with_junglegrass", @@ -2542,7 +2542,7 @@ minetest.register_decoration({ schematic = minetest.get_modpath("default") .. "/schematics/bush.mts", flags = "place_center_x, place_center_z", }) - + minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt_with_grass",}, @@ -2591,31 +2591,31 @@ minetest.register_decoration({ register_grass_decoration(0.015, 0.045, 2) register_grass_decoration(0.03, 0.03, 1) - --Jungle grasses - + --Jungle grasses + register_jungle_grass_decoration(-0.03, 0.09, 5) register_jungle_grass_decoration(-0.015, 0.075, 4) register_jungle_grass_decoration(0, 0.06, 3) register_jungle_grass_decoration(0.015, 0.045, 2) register_jungle_grass_decoration(0.03, 0.03, 1) - + --Snow grasses - + register_snow_grass_decoration(-0.03, 0.09, 5) register_snow_grass_decoration(-0.015, 0.075, 4) register_snow_grass_decoration(0, 0.06, 3) register_snow_grass_decoration(0.015, 0.045, 2) register_snow_grass_decoration(0.03, 0.03, 1) - + --Swamp grasses - - + + register_swamp_grass_decoration(-0.03, 0.09, 5) register_swamp_grass_decoration(-0.015, 0.075, 4) register_swamp_grass_decoration(0, 0.06, 3) register_swamp_grass_decoration(0.015, 0.045, 2) register_swamp_grass_decoration(0.03, 0.03, 1) - + -- Dry grasses register_dry_grass_decoration(0.01, 0.05, 5) @@ -2636,7 +2636,7 @@ minetest.register_decoration({ y_max = 31000, decoration = "default:junglegrass", }) - + --Aloe Vera minetest.register_decoration({ @@ -2669,9 +2669,9 @@ minetest.register_decoration({ y_max = 31000, decoration = "default:dry_shrub", }) - + --small cacti - + minetest.register_decoration({ deco_type = "simple", place_on = {"default:desert_sand", @@ -2690,7 +2690,7 @@ minetest.register_decoration({ y_max = 31000, decoration = "mapgen:small_cactus", }) - + minetest.register_decoration({ deco_type = "simple", place_on = {"default:desert_sand", @@ -2952,10 +2952,12 @@ if minetest.get_modpath("flowers_plus") then flowers_plus_decorations() end -if minetest.get_mapgen_params().mgname == "v6" then +local mg_name = minetest.get_mapgen_setting("mg_name") + +if mg_name == "v6" then farming.register_mgv6_decorations() flowers.register_mgv6_decorations() else farming.register_mgv7_decorations() flowers.register_decorations() -end \ No newline at end of file +end diff --git a/mods/mapgen/nodes.lua b/mods/mapgen/nodes.lua index f9c43de..d611503 100644 --- a/mods/mapgen/nodes.lua +++ b/mods/mapgen/nodes.lua @@ -9,6 +9,7 @@ minetest.register_node("mapgen:"..name, { tiles = { "mapgen_fern"..texnumber..".png", }, + use_texture_alpha = "clip", paramtype = "light", selection_box = { type = "fixed", @@ -30,6 +31,7 @@ minetest.register_node("mapgen:"..name, { tiles = { "mapgen_shrub"..texnumber..".png", }, + use_texture_alpha = "clip", paramtype = "light", selection_box = { type = "fixed", @@ -88,7 +90,7 @@ minetest.register_node("mapgen:dungeon_spawner", { elseif node_below == "default:desert_sand" then end minetest.chat_send_player(clicker:get_player_name(), "This node is unfinished") - end, + end, }) --plants (PLNT01) @@ -101,6 +103,7 @@ minetest.register_node("mapgen:waterlily", { paramtype2 = "facedir", visual_scale = 0.5, tiles = {"mapgen_waterlily_noflower.png",}, + use_texture_alpha = "clip", inventory_image = "mapgen_waterlily_item.png", wield_image = "mapgen_waterlily_item.png", liquids_pointable = true, @@ -132,7 +135,7 @@ minetest.register_node("mapgen:waterlily", { minetest.set_node(pos, {name = "flowers:waterlily", param2 = math.random(0, 3)}) end - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then itemstack:take_item() end else @@ -167,7 +170,7 @@ minetest.override_item("flowers:waterlily", { minetest.set_node(pos, {name = "flowers:waterlily", param2 = math.random(0, 3)}) end - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then itemstack:take_item() end else @@ -187,6 +190,7 @@ minetest.register_node("mapgen:dicksonia", { tiles = { "mapgen_dicksonia.png", }, + use_texture_alpha = "clip", paramtype = "light", selection_box = { type = "fixed", @@ -207,6 +211,7 @@ minetest.register_node("mapgen:statue", { tiles = { "mapgen_statue.png", }, + use_texture_alpha = "opaque", wield_scale = {x=0.5, y=0.5, z=0.5}, paramtype = "light", paramtype2 = "facedir", @@ -402,7 +407,7 @@ minetest.register_node("mapgen:creeper", { groups = {snappy=3, flammable=1, attached_node=1, flora=1}, sounds = default.node_sound_leaves_defaults(), is_ground_content=true, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, walkable = false, inventory_image = "mapgen_creeper.png", @@ -422,7 +427,7 @@ minetest.register_node("mapgen:cavefern1", { groups = {snappy=3, flammable=1, attached_node=1, flora=1}, sounds = default.node_sound_leaves_defaults(), is_ground_content=true, - buildable_to = true, + buildable_to = true, walkable = false, inventory_image = "mapgen_cavefern.png", paramtype = "light", @@ -442,7 +447,7 @@ minetest.register_node("mapgen:cavefern2", { groups = {snappy=3, flammable=1, attached_node=1, flora=1}, sounds = default.node_sound_leaves_defaults(), is_ground_content=true, - buildable_to = true, + buildable_to = true, walkable = false, inventory_image = "mapgen_cavefern2.png", paramtype = "light", @@ -582,7 +587,7 @@ minetest.register_node("mapgen:tallgrass", { tiles = {"mapgen_longgrass.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, inventory_image = "mapgen_longgrass.png", visual_scale = 2, @@ -602,7 +607,7 @@ minetest.register_node("mapgen:giantgrass", { tiles = {"mapgen_giantgrass.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, inventory_image = "mapgen_giantgrass.png", visual_scale = 4, @@ -623,7 +628,7 @@ minetest.register_node("mapgen:bananaplant", { tiles = {"mapgen_banana_plant.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, inventory_image = "mapgen_banana_plant.png", visual_scale = 2, @@ -643,7 +648,7 @@ minetest.register_node("mapgen:jungletree", { tiles = {"mapgen_jungletree.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, inventory_image = "mapgen_jungletree.png", visual_scale = 2, @@ -712,10 +717,11 @@ minetest.register_node("mapgen:bamboo_grass", { minetest.register_node("mapgen:bamboo", { description = "Bamboo", tiles = { - "mapgen_bamboo_top.png", + "mapgen_bamboo_top.png", "mapgen_bamboo_top.png", "mapgen_bamboo.png" }, + use_texture_alpha = "clip", is_ground_content = false, sunlight_propagates = false, groups = {choppy=1, flammable=1, oddly_breakable_by_hand=1, tree=1}, @@ -749,6 +755,7 @@ minetest.register_node("mapgen:bamboo_leaves", { description = "Bamboo Leaves", drawtype = "allfaces_optional", tiles = {"mapgen_bamboo_leaves.png"}, + use_texture_alpha = "clip", waving = 1, paramtype = "light", is_ground_content = false, @@ -789,6 +796,7 @@ minetest.register_node("mapgen:bamboo_with_leaves", { "mapgen_bamboo_top.png", "mapgen_bamboo_leaves.png^mapgen_bamboo.png" }, + use_texture_alpha = "clip", is_ground_content = false, sunlight_propagates = false, groups = {choppy=1, flammable=1, oddly_breakable_by_hand=1, tree=1, leaves=1}, @@ -831,7 +839,7 @@ minetest.register_node("mapgen:jungle_grass_1", { tiles = {"mapgen_jungle_grass_1.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, drop = "mapgen:jungle_grass_5", inventory_image = "mapgen_jungle_grass_1.png", @@ -850,7 +858,7 @@ minetest.register_node("mapgen:jungle_grass_2", { tiles = {"mapgen_jungle_grass_2.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, drop = "mapgen:jungle_grass_5", inventory_image = "mapgen_jungle_grass_2.png", @@ -869,7 +877,7 @@ minetest.register_node("mapgen:jungle_grass_3", { tiles = {"mapgen_jungle_grass_3.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, drop = "mapgen:jungle_grass_5", inventory_image = "mapgen_jungle_grass_3.png", @@ -888,7 +896,7 @@ minetest.register_node("mapgen:jungle_grass_4", { tiles = {"mapgen_jungle_grass_4.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, drop = "mapgen:jungle_grass_5", inventory_image = "mapgen_jungle_grass_4.png", @@ -907,7 +915,7 @@ minetest.register_node("mapgen:jungle_grass_5", { tiles = {"mapgen_jungle_grass_5.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, drop = "mapgen:jungle_grass_5", inventory_image = "mapgen_jungle_grass_5.png", @@ -930,7 +938,7 @@ minetest.register_node("mapgen:snow_grass_1", { tiles = {"mapgen_snow_grass_1.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, drop = "mapgen:snow_grass_5", inventory_image = "mapgen_snow_grass_1.png", @@ -949,7 +957,7 @@ minetest.register_node("mapgen:snow_grass_2", { tiles = {"mapgen_snow_grass_2.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, drop = "mapgen:snow_grass_5", inventory_image = "mapgen_snow_grass_2.png", @@ -968,7 +976,7 @@ minetest.register_node("mapgen:snow_grass_3", { tiles = {"mapgen_snow_grass_3.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, drop = "mapgen:snow_grass_5", inventory_image = "mapgen_snow_grass_3.png", @@ -987,7 +995,7 @@ minetest.register_node("mapgen:snow_grass_4", { tiles = {"mapgen_snow_grass_1.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, drop = "mapgen:snow_grass_5", inventory_image = "mapgen_snow_grass_4.png", @@ -1006,7 +1014,7 @@ minetest.register_node("mapgen:snow_grass_5", { tiles = {"mapgen_snow_grass_5.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, drop = "mapgen:snow_grass_5", inventory_image = "mapgen_snow_grass_5.png", @@ -1025,7 +1033,7 @@ minetest.register_node("mapgen:swamp_grass_1", { tiles = {"mapgen_swamp_grass_1.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, drop = "mapgen:swamp_grass_5", inventory_image = "mapgen_swamp_grass_1.png", @@ -1044,7 +1052,7 @@ minetest.register_node("mapgen:swamp_grass_2", { tiles = {"mapgen_swamp_grass_2.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, drop = "mapgen:swamp_grass_5", inventory_image = "mapgen_swamp_grass_2.png", @@ -1063,7 +1071,7 @@ minetest.register_node("mapgen:swamp_grass_3", { tiles = {"mapgen_swamp_grass_3.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, drop = "mapgen:swamp_grass_5", inventory_image = "mapgen_swamp_grass_3.png", @@ -1082,7 +1090,7 @@ minetest.register_node("mapgen:swamp_grass_4", { tiles = {"mapgen_swamp_grass_4.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, drop = "mapgen:swamp_grass_5", inventory_image = "mapgen_swamp_grass_4.png", @@ -1101,7 +1109,7 @@ minetest.register_node("mapgen:swamp_grass_5", { tiles = {"mapgen_swamp_grass_5.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, drop = "mapgen:swamp_grass_5", inventory_image = "mapgen_swamp_grass_5.png", @@ -1130,6 +1138,7 @@ minetest.register_node("mapgen:vine", { "mapgen_vine.png", "mapgen_vine.png", }, + use_texture_alpha = "clip", inventory_image = "mapgen_vine.png", paramtype = "light", paramtype2 = "facedir", @@ -1164,7 +1173,7 @@ minetest.register_node("mapgen:aloe_vera", { tiles = {"mapgen_aloe_vera.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, inventory_image = "mapgen_aloe_vera.png", groups = {snappy=3, flammable=1, attached_node=1, flora=1}, @@ -1182,7 +1191,7 @@ minetest.register_node("mapgen:cattail", { tiles = {"mapgen_cattail.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, inventory_image = "mapgen_cattail.png", visual_scale = 2, @@ -1202,7 +1211,7 @@ minetest.register_node("mapgen:small_cactus", { tiles = {"mapgen_small_cactus.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, inventory_image = "mapgen_small_cactus.png", groups = {snappy=3, flammable=1, attached_node=1, flora=1}, @@ -1220,7 +1229,7 @@ minetest.register_node("mapgen:small_cactus_1", { tiles = {"mapgen_small_cactus_1.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, inventory_image = "mapgen_small_cactus_1.png", groups = {snappy=3, flammable=1, attached_node=1, flora=1}, @@ -1238,7 +1247,7 @@ minetest.register_node("mapgen:wild_oat", { tiles = {"mapgen_wild_oat.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, inventory_image = "mapgen_wild_oat.png", groups = {snappy=3, flammable=1, attached_node=1, flora=1}, @@ -1256,7 +1265,7 @@ minetest.register_node("mapgen:wild_oat_dry", { tiles = {"mapgen_wild_oat_dry.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, inventory_image = "mapgen_wild_oat_dry.png", groups = {snappy=3, flammable=1, attached_node=1, flora=1}, @@ -1274,7 +1283,7 @@ minetest.register_node("mapgen:dead_grass_1", { tiles = {"mapgen_dead_grass_2.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, inventory_image = "mapgen_dead_grass_1.png", groups = {snappy=3, flammable=1, attached_node=1, flora=1, not_in_creative_inventory=1}, @@ -1293,7 +1302,7 @@ minetest.register_node("mapgen:dead_grass_2", { tiles = {"mapgen_dead_grass_3.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, inventory_image = "mapgen_dead_grass_2.png", groups = {snappy=3, flammable=1, attached_node=1, flora=1, not_in_creative_inventory=1}, @@ -1312,7 +1321,7 @@ minetest.register_node("mapgen:dead_grass_3", { tiles = {"mapgen_dead_grass_4.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, inventory_image = "mapgen_dead_grass_3.png", groups = {snappy=3, flammable=1, attached_node=1, flora=1, not_in_creative_inventory=1}, @@ -1331,7 +1340,7 @@ minetest.register_node("mapgen:dead_grass_4", { tiles = {"mapgen_dead_grass_5.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, inventory_image = "mapgen_dead_grass_4.png", groups = {snappy=3, flammable=1, attached_node=1, flora=1, not_in_creative_inventory=1}, @@ -1350,7 +1359,7 @@ minetest.register_node("mapgen:dead_grass_5", { tiles = {"mapgen_dead_grass_5.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, inventory_image = "mapgen_dead_grass_4.png", groups = {snappy=3, flammable=1, attached_node=1, flora=1}, @@ -1375,7 +1384,7 @@ minetest.register_node("mapgen:big_coral", { tiles = {"mapgen_big_coral.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, waving = 1, inventory_image = "mapgen_big_coral.png", @@ -1394,7 +1403,7 @@ minetest.register_node("mapgen:red_coral", { tiles = {"mapgen_pink_coral.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, waving = 1, inventory_image = "mapgen_pink_coral.png", @@ -1413,7 +1422,7 @@ minetest.register_node("mapgen:orange_coral", { tiles = {"mapgen_orange_coral.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, waving = 1, inventory_image = "mapgen_orange_coral.png", @@ -1432,7 +1441,7 @@ minetest.register_node("mapgen:blue_coral", { tiles = {"mapgen_blue_coral.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, waving = 1, inventory_image = "mapgen_blue_coral.png", @@ -1451,7 +1460,7 @@ minetest.register_node("mapgen:anemone", { tiles = {"mapgen_anemone.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, waving = 1, inventory_image = "mapgen_anemone.png", @@ -1506,7 +1515,7 @@ minetest.register_node("mapgen:seagrass_1", { tiles = {"mapgen_seagrass_1.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, waving = 1, inventory_image = "mapgen_seagrass_1.png", @@ -1530,7 +1539,7 @@ minetest.register_node("mapgen:seagrass_2", { tiles = {"mapgen_seagrass_2.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, waving = 1, inventory_image = "mapgen_seagrass_2.png", @@ -1550,7 +1559,7 @@ minetest.register_node("mapgen:seagrass_3", { tiles = {"mapgen_seagrass_3.png"}, paramtype = "light", is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, waving = 1, inventory_image = "mapgen_seagrass_3.png", @@ -1794,11 +1803,12 @@ minetest.register_node("mapgen:crystal_block", { name = "mapgen_crystal_stone.png", animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 1.00}, }}, + use_texture_alpha = "blend", drawtype = "nodebox", paramtype = "light", light_source = 7, groups = {cracky=2, dig_immediate=3, flammable=1}, - sounds = default.node_sound_glass_defaults() + sounds = default.node_sound_glass_defaults() }) minetest.register_node("mapgen:crystal_small", { @@ -1807,7 +1817,7 @@ minetest.register_node("mapgen:crystal_small", { name = "mapgen_crystal_anim.png", animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 1.00}, }}, - use_texture_alpha = true, + use_texture_alpha = "blend", drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", @@ -1828,7 +1838,7 @@ minetest.register_node("mapgen:crystal_small", { } }, groups = {cracky=2, dig_immediate=3, flammable=1}, - sounds = default.node_sound_glass_defaults() + sounds = default.node_sound_glass_defaults() }) minetest.register_node("mapgen:crystal", { @@ -1837,7 +1847,7 @@ minetest.register_node("mapgen:crystal", { name = "mapgen_crystal_anim.png", animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 1.00}, }}, - use_texture_alpha = true, + use_texture_alpha = "blend", drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", @@ -1914,7 +1924,7 @@ minetest.register_abm({ chance = 1, action = function(pos, node) if minetest.get_timeofday() <= 0.6 and minetest.get_timeofday() >= 0.2 and pos.y >= -20 then - return + return end minetest.add_particle({ pos = {x=pos.x, y=pos.y+0.1, z=pos.z}, @@ -1938,7 +1948,7 @@ minetest.register_abm({ chance = 1, action = function(pos, node) if minetest.get_timeofday() <= 0.6 and minetest.get_timeofday() >= 0.2 and pos.y >= -20 then - return + return end local dir = minetest.facedir_to_dir(node.param2) local particle_pos = {x=pos.x-0.22*dir.z*1.2, y=pos.y+0.1, z=pos.z-0.18*dir.x*1.2} @@ -1981,7 +1991,7 @@ minetest.register_node("mapgen:dirty_water_source", { drawtype = "liquid", tiles = { { - name = "mapgen_dirty_water_source_animated.png", + name = "mapgen_dirty_water_source_animated.png^[opacity:200", animation = { type = "vertical_frames", aspect_w = 16, @@ -1990,19 +2000,20 @@ minetest.register_node("mapgen:dirty_water_source", { }, }, }, - special_tiles = { - { - name = "mapgen_dirty_water_source_animated.png", - animation = { - type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, - length = 2.0, - }, - backface_culling = false, - }, - }, - alpha = 160, + -- special_tiles = { + -- { + -- name = "mapgen_dirty_water_source_animated.png", + -- animation = { + -- type = "vertical_frames", + -- aspect_w = 16, + -- aspect_h = 16, + -- length = 2.0, + -- }, + -- backface_culling = false, + -- }, + -- }, + -- alpha = 160, + use_texture_alpha = "blend", paramtype = "light", walkable = false, pointable = false, @@ -2025,10 +2036,10 @@ minetest.register_node("mapgen:dirty_water_source", { minetest.register_node("mapgen:dirty_water_flowing", { description = "Flowing Dirty Water", drawtype = "flowingliquid", - tiles = {"default_river_water.png^[colorize:green:100"}, + -- tiles = {"default_river_water.png^[colorize:green:100"}, special_tiles = { { - name = "mapgen_dirty_water_flowing_animated.png", + name = "mapgen_dirty_water_flowing_animated.png^[opacity:200", backface_culling = false, animation = { type = "vertical_frames", @@ -2038,7 +2049,7 @@ minetest.register_node("mapgen:dirty_water_flowing", { }, }, { - name = "mapgen_dirty_water_flowing_animated.png", + name = "mapgen_dirty_water_flowing_animated.png^[opacity:200", backface_culling = true, animation = { type = "vertical_frames", @@ -2048,7 +2059,8 @@ minetest.register_node("mapgen:dirty_water_flowing", { }, }, }, - alpha = 160, + -- alpha = 160, + use_texture_alpha = "blend", paramtype = "light", paramtype2 = "flowingliquid", walkable = false, @@ -2151,7 +2163,7 @@ minetest.register_node("mapgen:glowing_mushroom_white", { paramtype = "light", light_source = 9, is_ground_content = false, - buildable_to = true, + buildable_to = true, sunlight_propagates = true, inventory_image = "mapgen_glowing_mushroom_white.png", groups = {snappy=3, flammable=1, attached_node=1, flora=1}, diff --git a/mods/mapgen/textures/mapgen_dirty_water_flowing_animated.png b/mods/mapgen/textures/mapgen_dirty_water_flowing_animated.png index 0aceae8801525e7095b99c6773b1d17aee356cdb..cefb4ed8ca3f32b4fea06f1516f37a77da1c89ad 100644 GIT binary patch delta 297 zcmV+^0oMM<2Dk!{7=Ho-0001RqYK>t000S4OjJc7W>zS9Wm>eK(w|030002$Nkl+p9AQ_f5Ve7vmH|mg zJ|zQ@`HL?%{3n)OiP!o?avUTd6|My1K;RSf1oW8$tV?lnCs`+9r+d~GeovZDj delta 828 zcmV-C1H=5d0>=iB7=H)`0000D&Erl0000JJOGiWiWdHyGD4ithxBvhE32;bRa{vGf z6951U69E94oEQKA00(qQO+^Rc2n!Y-9a&K#g8%>m)Ja4^RA}DqS+QyyK@8Q62hJG6 z6$gP7NeH+IDP0-+Kl}$t>pCBJSKd!-an%-EnZ+1V7_GJ1Cx4CZAR!4FFy|d+X0>{6 zo;0J?mmd$0q}qDBAtIui`@5;{u-h;Ch=^)rGJ56(7Ym@qgHfyJP9FQ=b%FJEGd+0C z8dKzVqsHHk#;ms+Dsq73K5!d_cgJ=_nw zJ++ux?*&hhTB_7kq?RgGFX~ugA}uP>$(FnoZ@WeoDiT+Xaip1{&09?N z6-^w8FriBJHG>oK2tLDU!8M_<4oS zjruJ*BK;XfvgjRBq^KI1Ig<8#SdpwO%~PZW6MxZ`^<=H+NQ2Dv&JZ(2Y900A;rkR( zMUMVoM75Pvhb1klMy8~lnq-arkV)3Rkz|D=%?shpEbZKDusnGFbq7xr!aWww4xUyF z^q`fBRIQ6fnOu9inHN#N>mo|amv<3WBjkC<5$ofLo7c$Mu`a;$h^5~oO zg*B`%WPKs)3t3;t`a;$hvc8Z>R@N7?zL52WtS@AJL9|~)Ri`iXR}+c=0000$m^_010qNS#tmY3ljhU3ljkVnw%H_000McNliru;Rp*B9vxXxB7*<`0@O)F zK~!ko?OCyE96=1#jR(#c!W9RB6iEoU2q|3|`#<~#N$WZvcvs#}Y;n~VTbaceQW&kZ z+9!?fAR!4FFy|d+X0>{6o;0J?mmd$0q}qDBAtIui`@5;{u-h;Ch=^)rGJ56(7Ym@q zgHfyJP9FQ=b%FJEGd+0C8dKzVqsHHk#;ms+Dsq73K(#VCR1!F(Zdb@e^fgX(DLKg6t3C6J> zCb$?X9(3$Fs#lj2lsETx6O7d|QL|54CM~WlEwHHVDw1}Tv{J)bA_UT(IOBmHEWh7V zqp+lTv<^v{rAGW)TQDJZx{`+CfM(}mx1a9?Pmx-x)KsLFDpfD)SYjeAD$&W7ycKV| zMiwd(SB-I`nW4>FO!gH`9EmYnME9ABBrQUU#C^rvt`@DiZ|n!Uc=zr477<5Uf~=dt z=#d6l*Hk1VU8W*=;(>x}Q<0FUxRQq6CgVYiSQWu#L5CJumo|amv<3WBjkC<5$ofLo z7c$Mu`a;$h^5~oOg{&`ReIe@$SzpNdLe>|uzK}^)))%tAkoASEFJyf|v|mJ3r!VwZ R6N&%;002ovPDHLkV1gg8ePsXu literal 0 HcmV?d00001 diff --git a/mods/mines/init.lua b/mods/mines/init.lua index c31f968..a2cbe93 100644 --- a/mods/mines/init.lua +++ b/mods/mines/init.lua @@ -1,6 +1,6 @@ -local MINE_DEEP_MIN = tonumber(minetest.setting_get("mines_deep_min")) or -64 -local MINE_DEEP_MAX = tonumber(minetest.setting_get("mines_deep_max")) or -380 -local MINE_FACTOR = tonumber(minetest.setting_get("mines_spawnfactor")) or 1.5 +local MINE_DEEP_MIN = tonumber(minetest.settings:get("mines_deep_min")) or -64 +local MINE_DEEP_MAX = tonumber(minetest.settings:get("mines_deep_max")) or -380 +local MINE_FACTOR = tonumber(minetest.settings:get("mines_spawnfactor")) or 1.5 minetest.register_node("mines:dummy", { diff --git a/mods/mobs_farlands/flying.lua b/mods/mobs_farlands/flying.lua index fc0e377..1baa01a 100644 --- a/mods/mobs_farlands/flying.lua +++ b/mods/mobs_farlands/flying.lua @@ -160,7 +160,7 @@ mobs:register_mob("mobs_m:pterodactyl_walking", { local obj = minetest.add_entity(pos, "mobs_m:pterodactyl") local newmob = obj:get_luaentity() newmob.hp = self.object:get_hp() - obj:setpos({x=pos.x, y=pos.y+1, z=pos.z}) + obj:set_pos({x=pos.x, y=pos.y+1, z=pos.z}) self.object:remove() end end, diff --git a/mods/mobs_farlands/land.lua b/mods/mobs_farlands/land.lua index 5af8c3b..f0ee49e 100644 --- a/mods/mobs_farlands/land.lua +++ b/mods/mobs_farlands/land.lua @@ -45,7 +45,7 @@ mobs:register_mob("mobs_m:mimic", { if self.state ~= "attack" then minetest.after(3, function() if self.state ~= "attack" and self.object ~= nil then - local pos = self.object:getpos() + local pos = self.object:get_pos() if pos ~= nil then minetest.set_node(pos, {name="mobs_m:mimic_chest", param2=1}) self.object:remove() @@ -117,7 +117,7 @@ mobs:register_mob("mobs_m:mimic2", { if self.state ~= "attack" then minetest.after(3, function() if self.state ~= "attack" and self.object ~= nil then - local pos = self.object:getpos() + local pos = self.object:get_pos() if pos ~= nil then minetest.set_node(pos, {name="mobs_m:mimic_chest2", param2=1}) self.object:remove() @@ -345,7 +345,7 @@ mobs:register_mob("mobs_m:cow", { if inv:room_for_item("main", {name = "mobs:bucket_milk"}) then clicker:get_inventory():add_item("main", "mobs:bucket_milk") else - local pos = self.object:getpos() + local pos = self.object:get_pos() pos.y = pos.y + 0.5 minetest.add_item(pos, {name = "mobs:bucket_milk"}) end @@ -742,7 +742,7 @@ mobs:register_arrow("mobs_m:stone", { on_activate = function(self) self.object:set_properties({visual_size = {x=0, y=0},}) - local pos = self.object:getpos() + local pos = self.object:get_pos() local velo = self.object:get_velocity() self.object:set_pos({x=pos.x, y=pos.y+1.5, z=pos.z}) minetest.after(0.5, function() @@ -825,8 +825,8 @@ mobs:register_arrow("mobs_m:lightning", { end, on_step = function(self) - local velo = self.object:getvelocity() - local pos = self.object:getpos() + local velo = self.object:get_velocity() + local pos = self.object:get_pos() minetest.add_particle({ pos = {x=pos.x, y=pos.y, z=pos.z}, velocity = {x=0, y=0, z=0}, @@ -1183,13 +1183,13 @@ for _, col in pairs(all_colours) do self.gotten = true -- shaved local obj = minetest.add_item( - self.object:getpos(), + self.object:get_pos(), ItemStack( "wool:" .. col[1] .. " " .. math.random(1, 3) ) ) if obj then - obj:setvelocity({ + obj:set_velocity({ x = math.random(-1, 1), y = 5, z = math.random(-1, 1) @@ -1224,7 +1224,7 @@ for _, col in pairs(all_colours) do if c[1] == colr then - local pos = self.object:getpos() + local pos = self.object:get_pos() self.object:remove() @@ -1235,7 +1235,7 @@ for _, col in pairs(all_colours) do ent.tamed = true -- take item - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then item:take_item() clicker:set_wielded_item(item) end @@ -1393,7 +1393,7 @@ mobs:register_mob("mobs_m:chicken", { return end - local pos = self.object:getpos() + local pos = self.object:get_pos() minetest.add_item(pos, "mobs:egg") @@ -1491,7 +1491,7 @@ local egg_VELOCITY = 19 -- shoot egg local mobs_shoot_egg = function (item, player, pointed_thing) - local playerpos = player:getpos() + local playerpos = player:get_pos() minetest.sound_play("default_place_node_hard", { pos = playerpos, @@ -1511,13 +1511,13 @@ local mobs_shoot_egg = function (item, player, pointed_thing) ent.velocity = egg_VELOCITY -- needed for api internal timing ent.switch = 1 -- needed so that egg doesn't despawn straight away - obj:setvelocity({ + obj:set_velocity({ x = dir.x * egg_VELOCITY, y = dir.y * egg_VELOCITY, z = dir.z * egg_VELOCITY }) - obj:setacceleration({ + obj:set_acceleration({ x = dir.x * -3, y = -egg_GRAVITY, z = dir.z * -3 diff --git a/mods/mobs_npc/igor.lua b/mods/mobs_npc/igor.lua index a1b6bce..41d6671 100644 --- a/mods/mobs_npc/igor.lua +++ b/mods/mobs_npc/igor.lua @@ -77,12 +77,12 @@ mobs:register_mob("mobs_npc:igor", { -- right clicking with gold lump drops random item from mobs.npc_drops if item:get_name() == "default:gold_lump" then - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then item:take_item() clicker:set_wielded_item(item) end - local pos = self.object:getpos() + local pos = self.object:get_pos() pos.y = pos.y + 0.5 minetest.add_item(pos, { diff --git a/mods/mobs_npc/init.lua b/mods/mobs_npc/init.lua index 1495354..b1f4010 100644 --- a/mods/mobs_npc/init.lua +++ b/mods/mobs_npc/init.lua @@ -78,7 +78,7 @@ minetest.register_node("mobs_npc:beacon", { {0.4375, -0.5, -0.5, 0.5, 0.5, -0.4375}, -- NodeBox12 } }, - use_texture_alpha = true, + use_texture_alpha = "blend", groups = {cracky=1, oddly_breakeable_by_hand=1}, sounds = default.node_sound_glass_defaults() }) @@ -101,4 +101,4 @@ minetest.register_craft({ {'default:glass', 'default:diamond', 'default:glass'}, {'', 'default:glass', ''}, } -}) \ No newline at end of file +}) diff --git a/mods/mobs_npc/npc.lua b/mods/mobs_npc/npc.lua index 64256f6..049bb18 100644 --- a/mods/mobs_npc/npc.lua +++ b/mods/mobs_npc/npc.lua @@ -16,16 +16,16 @@ minetest.register_entity("mobs_npc:dummy", { }) local npc_make_home = function(self, dtime) - local pos = self.object:getpos() + local pos = self.object:get_pos() pos.y = pos.y + 0.5 - + local beds = minetest.find_node_near(pos, 5, {"beds:bed_bottom", "beds:bed", "beds:bed_yellow_bottom", "beds:bed_brown_bottom", "beds:bed_magenta_bottom", "beds:bed_blue_bottom", "beds:bed_orange_bottom", "beds:bed_cyan_bottom", "beds:bed_pink_bottom", "beds:bed_black_bottom", "beds:bed_white_bottom", "beds:bed_darkgrey_bottom", "beds:bed_grey_bottom", "beds:bed_green_bottom", "beds:bed_purple_bottom", "beds:bed_darkgreen_bottom"}) local light_sources = minetest.find_node_near(pos, 5, {"default:torch", "default:torch_wall", "default:torch_floor", "default:torch_ceiling", "decoblocks:lantern", "decoblocks:lantern_wall", "mese_lamp"}) local doors = minetest.find_node_near(pos, 5, {"group:door", "doors:door_wood_a", "doors:door_glass_a", "doors:door_obsidian_glass_a"}) local is_owned = minetest.find_node_near(pos, 5, {"villages:colony_deed", "villages:hobo_deed",}) local node_below = minetest.get_node({x=pos.x, y=pos.y-1.5, z=pos.z}).name local good_floor = minetest.get_item_group(node_below, "crumbly") - if beds ~= nil and light_sources ~= nil and doors ~= nil and is_owned == nil and self.home == nil and good_floor == 0 then + if beds ~= nil and light_sources ~= nil and doors ~= nil and is_owned == nil and self.home == nil and good_floor == 0 then self.home = pos local free_space = minetest.find_node_near(light_sources, 1, {"air"}) local pos1 = free_space @@ -47,7 +47,7 @@ local npc_make_home = function(self, dtime) end local npc_go_home = function(self, dtime) self.home_timer = (self.home_timer or 0) + dtime - if self.home_timer < 1 then + if self.home_timer < 1 then npc_make_home(self, dtime) return end -- every 1 second self.home_timer = 0 @@ -56,7 +56,7 @@ local npc_go_home = function(self, dtime) npc_make_home(self, dtime) return -- return if not night time end - + if self.home == nil then --minetest.chat_send_all("something went wrong") npc_make_home(self, dtime) @@ -64,7 +64,7 @@ local npc_go_home = function(self, dtime) end --minetest.chat_send_all(minetest.pos_to_string(self.home)) local h = self.home -- destination coords - local p = self.object:getpos() -- mob position + local p = self.object:get_pos() -- mob position local x, y, z = p.x - h.x, p.y - h.y, p.z - h.z local dist = math.floor(math.sqrt(x * x + y * y + z * z)) @@ -96,19 +96,19 @@ local npc_go_home = function(self, dtime) if np.x > p.x then yaw = yaw + math.pi end - self.object:setyaw(yaw) + self.object:set_yaw(yaw) set_velocity(self, self.walk_velocity) end end local set_velocity = function(self, v) - local yaw = (self.object:getyaw() or 0) + self.rotate + local yaw = (self.object:get_yaw() or 0) + self.rotate - self.object:setvelocity({ - x = sin(yaw) * -v, - y = self.object:getvelocity().y, - z = cos(yaw) * v + self.object:set_velocity({ + x = math.sin(yaw) * -v, + y = self.object:get_velocity().y, + z = math.cos(yaw) * v }) end @@ -165,7 +165,7 @@ mobs:register_mob("mobs_npc:npc", { punch_end = 65, }, do_custom = function(self, dtime) - + --npc_go_home(self, dtime) self.home_timer = (self.home_timer or 0) + dtime @@ -177,11 +177,11 @@ mobs:register_mob("mobs_npc:npc", { if self.time_of_day > 0.2 and self.time_of_day < 0.8 then return -- return if not night time end - + if self.home == nil then return end local h = self.home--{x = 1, y = 8, z = 2} -- destination coords - local p = self.object:getpos() -- mob position + local p = self.object:get_pos() -- mob position local x, y, z = p.x - h.x, p.y - h.y, p.z - h.z local dist = math.floor(math.sqrt(x * x + y * y + z * z)) @@ -213,24 +213,24 @@ mobs:register_mob("mobs_npc:npc", { if np.x > p.x then yaw = yaw + math.pi end - self.object:setyaw(yaw) + self.object:set_yaw(yaw) set_velocity(self, self.walk_velocity) end - + --local game_time = minetest.get_timeofday()*24000 - + --[[if game_time <= 6000 or game_time >= 18000 and self.home ~= nil then local pos1 = self.home if math.abs(pos1.x-pos.x) >= 10 or math.abs(pos1.z-pos.z) >= 10 then - self.object:setpos({x=pos1.x, y=pos1.y-0.5, z=pos1.z}) + self.object:set_pos({x=pos1.x, y=pos1.y-0.5, z=pos1.z}) end - end]] + end]] end, on_rightclick = function(self, clicker) local item = clicker:get_wielded_item() local name = clicker:get_player_name() - + -- feed to heal npc if mobs:feed_tame(self, clicker, 8, true, true) then return @@ -240,12 +240,12 @@ mobs:register_mob("mobs_npc:npc", { -- right clicking with gold lump drops random item from mobs.npc_drops if item:get_name() == "default:gold_lump" then - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then item:take_item() clicker:set_wielded_item(item) end - local pos = self.object:getpos() + local pos = self.object:get_pos() pos.y = pos.y + 0.5 diff --git a/mods/mobs_redo/api.lua b/mods/mobs_redo/api.lua index 963cbe6..a4e724e 100644 --- a/mods/mobs_redo/api.lua +++ b/mods/mobs_redo/api.lua @@ -52,19 +52,19 @@ end -- Load settings -local damage_enabled = minetest.setting_getbool("enable_damage") -local peaceful_only = minetest.setting_getbool("only_peaceful_mobs") -local disable_blood = minetest.setting_getbool("mobs_disable_blood") -local creative = minetest.setting_getbool("creative_mode") -local spawn_protected = tonumber(minetest.setting_get("mobs_spawn_protected")) or 1 -local remove_far = minetest.setting_getbool("remove_far_mobs") -local difficulty = tonumber(minetest.setting_get("mob_difficulty")) or 1.0 -local show_health = minetest.setting_getbool("mob_show_health") ~= false -local max_per_block = tonumber(minetest.setting_get("max_objects_per_block") or 99) +local damage_enabled = minetest.settings:get_bool("enable_damage") +local peaceful_only = minetest.settings:get_bool("only_peaceful_mobs") +local disable_blood = minetest.settings:get_bool("mobs_disable_blood") +local creative = minetest.settings:get_bool("creative_mode") +local spawn_protected = tonumber(minetest.settings:get("mobs_spawn_protected")) or 1 +local remove_far = minetest.settings:get_bool("remove_far_mobs") +local difficulty = tonumber(minetest.settings:get("mob_difficulty")) or 1.0 +local show_health = minetest.settings:get_bool("mob_show_health") ~= false +local max_per_block = tonumber(minetest.settings:get("max_objects_per_block") or 99) -- calculate aoc range for mob count -local aosrb = tonumber(minetest.setting_get("active_object_send_range_blocks")) -local abr = tonumber(minetest.setting_get("active_block_range")) +local aosrb = tonumber(minetest.settings:get("active_object_send_range_blocks")) +local abr = tonumber(minetest.settings:get("active_block_range")) local aoc_range = max(aosrb, abr) * 16 -- pathfinding settings @@ -105,11 +105,11 @@ end -- move mob in facing direction local set_velocity = function(self, v) - local yaw = (self.object:getyaw() or 0) + self.rotate + local yaw = (self.object:get_yaw() or 0) + self.rotate - self.object:setvelocity({ + self.object:set_velocity({ x = sin(yaw) * -v, - y = self.object:getvelocity().y, + y = self.object:get_velocity().y, z = cos(yaw) * v }) end @@ -118,7 +118,7 @@ end -- get overall speed of mob local get_velocity = function(self) - local v = self.object:getvelocity() + local v = self.object:get_velocity() return (v.x * v.x + v.z * v.z) ^ 0.5 end @@ -131,7 +131,7 @@ local set_yaw = function(self, yaw) yaw = 0 end - self:setyaw(yaw) + self:set_yaw(yaw) return yaw end @@ -327,7 +327,7 @@ end local item_drop = function(self, cooked) local obj, item, num - local pos = self.object:getpos() + local pos = self.object:get_pos() self.drops = self.drops or {} -- nil check @@ -354,7 +354,7 @@ local item_drop = function(self, cooked) if obj and obj:get_luaentity() then - obj:setvelocity({ + obj:set_velocity({ x = random(-10, 10) / 9, y = 6, z = random(-10, 10) / 9, @@ -408,7 +408,7 @@ local check_for_death = function(self, cause) mob_sound(self, self.sounds.death) - local pos = self.object:getpos() + local pos = self.object:get_pos() -- execute custom death function if self.on_die then @@ -469,10 +469,10 @@ local is_at_cliff = function(self) return false end - local yaw = self.object:getyaw() + local yaw = self.object:get_yaw() local dir_x = -sin(yaw) * (self.collisionbox[4] + 0.5) local dir_z = cos(yaw) * (self.collisionbox[4] + 0.5) - local pos = self.object:getpos() + local pos = self.object:get_pos() local ypos = pos.y + self.collisionbox[2] -- just above floor if minetest.line_of_sight( @@ -523,7 +523,7 @@ local do_env_damage = function(self) update_tag(self) end - local pos = self.object:getpos() + local pos = self.object:get_pos() self.time_of_day = minetest.get_timeofday() @@ -554,7 +554,7 @@ local do_env_damage = function(self) -- don't fall when on ignore, just stand still if self.standing_in == "ignore" then - self.object:setvelocity({x = 0, y = 0, z = 0}) + self.object:set_velocity({x = 0, y = 0, z = 0}) --print ("--- stopping on ignore") end @@ -640,12 +640,12 @@ local do_jump = function(self) -- something stopping us while moving? if self.state ~= "stand" and get_velocity(self) > 0.5 - and self.object:getvelocity().y ~= 0 then + and self.object:get_velocity().y ~= 0 then return false end - local pos = self.object:getpos() - local yaw = self.object:getyaw() + local pos = self.object:get_pos() + local yaw = self.object:get_yaw() -- what is mob standing on? pos.y = pos.y + self.collisionbox[2] - 0.2 @@ -681,13 +681,13 @@ local do_jump = function(self) and not nod.name:find("gate")) or self.walk_chance == 0 then - local v = self.object:getvelocity() + local v = self.object:get_velocity() v.y = self.jump_height -- + 1 set_animation(self, "jump") -- only when defined - self.object:setvelocity(v) + self.object:set_velocity(v) mob_sound(self, self.sounds.jump) @@ -708,7 +708,7 @@ local entity_physics = function(pos, radius) for n = 1, #objs do - obj_pos = objs[n]:getpos() + obj_pos = objs[n]:get_pos() dist = get_distance(pos, obj_pos) if dist < 1 then dist = 1 end @@ -776,7 +776,7 @@ local breed = function(self) }) -- jump when fully grown so not to fall into ground - self.object:setvelocity({ + self.object:set_velocity({ x = 0, y = self.jump_height, z = 0 @@ -803,7 +803,7 @@ local breed = function(self) if self.horny == true and self.hornytimer <= 40 then - local pos = self.object:getpos() + local pos = self.object:get_pos() effect({x = pos.x, y = pos.y + 1, z = pos.z}, 8, "heart.png", 3, 4, 1, 0.1) @@ -896,7 +896,7 @@ local replace = function(self, pos) if not self.replace_rate or not self.replace_what or self.child == true - or self.object:getvelocity().y ~= 0 + or self.object:get_velocity().y ~= 0 or random(1, self.replace_rate) > 1 then return end @@ -987,7 +987,7 @@ local smart_mobs = function(self, s, p, dist, dtime) s.y = sground.y + 1 end - local p1 = self.attack:getpos() + local p1 = self.attack:get_pos() p1.x = floor(p1.x + 0.5) p1.y = floor(p1.y + 0.5) @@ -996,7 +996,7 @@ local smart_mobs = function(self, s, p, dist, dtime) self.path.way = minetest.find_path(s, p1, 16, 2, 6, "Dijkstra") -- attempt to unstick mob that is "daydreaming" - self.object:setpos({ + self.object:set_pos({ x = s.x + 0.1 * (random() * 2 - 1), y = s.y + 1, z = s.z + 0.1 * (random() * 2 - 1) @@ -1051,11 +1051,11 @@ local smart_mobs = function(self, s, p, dist, dtime) end s.y = s.y - sheight - self.object:setpos({x = s.x, y = s.y + 2, z = s.z}) + self.object:set_pos({x = s.x, y = s.y + 2, z = s.z}) else -- dig 2 blocks to make door toward player direction - local yaw1 = self.object:getyaw() + pi / 2 + local yaw1 = self.object:get_yaw() + pi / 2 local p1 = { x = s.x + cos(yaw1), y = s.y, @@ -1143,7 +1143,8 @@ local monster_attack = function(self) return end - local s = self.object:getpos() + local s = self.object:get_pos() + assert(s, self.name .. " has no position") local p, sp, dist local player, obj, min_player local type, name = "", "" @@ -1177,8 +1178,8 @@ local monster_attack = function(self) and (type == "player" or type == "npc" or (type == "animal" and self.attack_animals == true)) then - s = self.object:getpos() - p = player:getpos() + s = self.object:get_pos() + p = player:get_pos() sp = s -- aim higher to make looking up hills more realistic @@ -1216,7 +1217,7 @@ local npc_attack = function(self) return end - local s = self.object:getpos() + local s = self.object:get_pos() local min_dist = self.view_range + 1 local obj, min_player = nil, nil local objs = minetest.get_objects_inside_radius(s, self.view_range) @@ -1227,9 +1228,9 @@ local npc_attack = function(self) if obj and obj.type == "monster" then - local p = obj.object:getpos() + local p = obj.object:get_pos() - dist = get_distance(p, s) + local dist = get_distance(p, s) if dist < min_dist then min_dist = dist @@ -1254,12 +1255,12 @@ local follow_flop = function(self) and self.state ~= "attack" and self.state ~= "runaway" then - local s = self.object:getpos() + local s = self.object:get_pos() local players = minetest.get_connected_players() for n = 1, #players do - if get_distance(players[n]:getpos(), s) < self.view_range + if get_distance(players[n]:get_pos(), s) < self.view_range and not mobs.invis[ players[n]:get_player_name() ] then self.following = players[n] @@ -1293,16 +1294,16 @@ local follow_flop = function(self) -- follow that thing if self.following then - local s = self.object:getpos() + local s = self.object:get_pos() local p if self.following:is_player() then - p = self.following:getpos() + p = self.following:get_pos() elseif self.following.object then - p = self.following.object:getpos() + p = self.following.object:get_pos() end if p then @@ -1345,11 +1346,11 @@ local follow_flop = function(self) -- swimmers flop when out of their element, and swim again when back in if self.fly then - local s = self.object:getpos() + local s = self.object:get_pos() if not flight_check(self, s) then self.state = "flop" - self.object:setvelocity({x = 0, y = -5, z = 0}) + self.object:set_velocity({x = 0, y = -5, z = 0}) set_animation(self, "stand") @@ -1400,13 +1401,13 @@ local do_states = function(self, dtime) if random(1, 4) == 1 then local lp = nil - local s = self.object:getpos() + local s = self.object:get_pos() local objs = minetest.get_objects_inside_radius(s, 3) for n = 1, #objs do if objs[n]:is_player() then - lp = objs[n]:getpos() + lp = objs[n]:get_pos() break end end @@ -1447,17 +1448,17 @@ local do_states = function(self, dtime) -- fly up/down randombly for flying mobs if self.fly and random(1, 100) <= self.walk_chance then - local v = self.object:getvelocity() + local v = self.object:get_velocity() local ud = random(-1, 2) / 9 - self.object:setvelocity({x = v.x, y = ud, z = v.z}) + self.object:set_velocity({x = v.x, y = ud, z = v.z}) end end end elseif self.state == "walk" then - local s = self.object:getpos() + local s = self.object:get_pos() local lp = nil -- is there something I need to avoid? @@ -1571,14 +1572,14 @@ local do_states = function(self, dtime) elseif self.state == "attack" then -- calculate distance from mob and enemy - local s = self.object:getpos() - local p = self.attack:getpos() or s + local s = self.object:get_pos() + local p = self.attack:get_pos() or s local dist = get_distance(p, s) -- stop attacking if player or out of range if dist > self.view_range or not self.attack - or not self.attack:getpos() + or not self.attack:get_pos() or self.attack:get_hp() <= 0 or (self.attack:is_player() and mobs.invis[ self.attack:get_player_name() ]) then @@ -1645,7 +1646,7 @@ local do_states = function(self, dtime) if self.timer > 3 then - local pos = self.object:getpos() + local pos = self.object:get_pos() local radius = self.explosion_radius or 1 -- dont damage anything if area protected or next to water @@ -1687,13 +1688,13 @@ local do_states = function(self, dtime) local me_y = floor(p1.y) local p2 = p local p_y = floor(p2.y + 1) - local v = self.object:getvelocity() + local v = self.object:get_velocity() if flight_check(self, s) then if me_y < p_y then - self.object:setvelocity({ + self.object:set_velocity({ x = v.x, y = 1 * self.walk_velocity, z = v.z @@ -1701,7 +1702,7 @@ local do_states = function(self, dtime) elseif me_y > p_y then - self.object:setvelocity({ + self.object:set_velocity({ x = v.x, y = -1 * self.walk_velocity, z = v.z @@ -1710,7 +1711,7 @@ local do_states = function(self, dtime) else if me_y < p_y then - self.object:setvelocity({ + self.object:set_velocity({ x = v.x, y = 0.01, z = v.z @@ -1718,7 +1719,7 @@ local do_states = function(self, dtime) elseif me_y > p_y then - self.object:setvelocity({ + self.object:set_velocity({ x = v.x, y = -0.01, z = v.z @@ -1878,7 +1879,7 @@ local do_states = function(self, dtime) -- play shoot attack sound mob_sound(self, self.sounds.shoot_attack) - local p = self.object:getpos() + local p = self.object:get_pos() p.y = p.y + (self.collisionbox[2] + self.collisionbox[5]) / 2 @@ -1897,7 +1898,7 @@ local do_states = function(self, dtime) vec.y = vec.y * (v / amount) vec.z = vec.z * (v / amount) - obj:setvelocity(vec) + obj:set_velocity(vec) else obj:remove() -- arrow entity does not exist end @@ -1915,12 +1916,12 @@ local falling = function(self, pos) end -- floating in water (or falling) - local v = self.object:getvelocity() + local v = self.object:get_velocity() -- going up then apply gravity if v.y > 0.1 then - self.object:setacceleration({ + self.object:set_acceleration({ x = 0, y = self.fall_speed, z = 0 @@ -1933,7 +1934,7 @@ local falling = function(self, pos) if self.floats == 1 then - self.object:setacceleration({ + self.object:set_acceleration({ x = 0, y = -self.fall_speed / (max(1, v.y) ^ 2), z = 0 @@ -1941,7 +1942,7 @@ local falling = function(self, pos) end else -- fall downwards - self.object:setacceleration({ + self.object:set_acceleration({ x = 0, y = self.fall_speed, z = 0 @@ -1949,9 +1950,9 @@ local falling = function(self, pos) -- fall damage if self.fall_damage == 1 - and self.object:getvelocity().y == 0 then + and self.object:get_velocity().y == 0 then - local d = (self.old_y or 0) - self.object:getpos().y + local d = (self.old_y or 0) - self.object:get_pos().y if d > 5 then @@ -1964,7 +1965,7 @@ local falling = function(self, pos) end end - self.old_y = self.object:getpos().y + self.old_y = self.object:get_pos().y end end end @@ -1986,7 +1987,7 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir) -- is mob protected? if self.protected and hitter:is_player() - and minetest.is_protected(self.object:getpos(), hitter:get_player_name()) then + and minetest.is_protected(self.object:get_pos(), hitter:get_player_name()) then minetest.chat_send_player(hitter:get_player_name(), "Mob has been protected!") return end @@ -2073,7 +2074,7 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir) if self.blood_amount > 0 and not disable_blood then - local pos = self.object:getpos() + local pos = self.object:get_pos() pos.y = pos.y + (-self.collisionbox[2] + self.collisionbox[5]) * .5 @@ -2107,7 +2108,7 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir) if self.knock_back > 0 and tflp >= punch_interval then - local v = self.object:getvelocity() + local v = self.object:get_velocity() local r = 1.4 - min(punch_interval, 1.4) local kb = r * 5 local up = 2 @@ -2121,7 +2122,7 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir) -- direction error check dir = dir or {x = 0, y = 0, z = 0} - self.object:setvelocity({ + self.object:set_velocity({ x = dir.x * kb, y = up, z = dir.z * kb @@ -2134,8 +2135,8 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir) -- if skittish then run away if self.runaway == true then - local lp = hitter:getpos() - local s = self.object:getpos() + local lp = hitter:get_pos() + local s = self.object:get_pos() local vec = { x = lp.x - s.x, @@ -2169,7 +2170,7 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir) do_attack(self, hitter) -- alert others to the attack - local objs = minetest.get_objects_inside_radius(hitter:getpos(), self.view_range) + local objs = minetest.get_objects_inside_radius(hitter:get_pos(), self.view_range) local obj = nil for n = 1, #objs do @@ -2329,7 +2330,7 @@ local mob_activate = function(self, staticdata, def) -- end init self.object:set_armor_groups({immortal = 1, fleshy = self.armor}) - self.old_y = self.object:getpos().y + self.old_y = self.object:get_pos().y self.old_health = self.health self.sounds.distance = self.sounds.distance or 10 self.textures = textures @@ -2348,7 +2349,7 @@ end -- main mob function local mob_step = function(self, dtime) - local pos = self.object:getpos() + local pos = self.object:get_pos() local yaw = 0 -- when lifetimer expires remove mob (except npc and tamed) @@ -2375,8 +2376,8 @@ local mob_step = function(self, dtime) end end --- minetest.log("action", --- S("lifetimer expired, removed @1", self.name)) + -- minetest.log("action", + -- S("lifetimer expired, removed @1", self.name)) effect(pos, 15, "tnt_smoke.png", 2, 4, 2, 0) @@ -2387,6 +2388,7 @@ local mob_step = function(self, dtime) end falling(self, pos) + if self.health <=0 then return end -- knockback timer if self.pause_timer > 0 then @@ -2443,6 +2445,7 @@ local mob_step = function(self, dtime) self.env_damage_timer = 0 do_env_damage(self) + if self.health <=0 then return end end monster_attack(self) @@ -2624,7 +2627,7 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light, interval, chance, aoc, min_height, max_height, day_toggle, on_spawn) -- chance/spawn number override in minetest.conf for registered mob - local numbers = minetest.setting_get(name) + local numbers = minetest.settings:get(name) if numbers then numbers = numbers:split(",") @@ -2908,7 +2911,7 @@ function mobs:register_arrow(name, def) self.timer = self.timer + 1 - local pos = self.object:getpos() + local pos = self.object:get_pos() if self.switch == 0 or self.timer > 150 @@ -3219,7 +3222,7 @@ function mobs:capture_mob(self, clicker, chance_hand, chance_net, chance_lasso, if inv:room_for_item("main", new_stack) then inv:add_item("main", new_stack) else - minetest.add_item(clicker:getpos(), new_stack) + minetest.add_item(clicker:get_pos(), new_stack) end self.object:remove() @@ -3430,7 +3433,7 @@ function mobs:alias_mob(old_name, new_name) on_step = function(self) - local pos = self.object:getpos() + local pos = self.object:get_pos() minetest.add_entity(pos, new_name) diff --git a/mods/mobs_redo/api.txt b/mods/mobs_redo/api.txt index dd56748..1f05d3b 100644 --- a/mods/mobs_redo/api.txt +++ b/mods/mobs_redo/api.txt @@ -434,7 +434,7 @@ mobs:register_mob("mob_horse:horse", { if inv:room_for_item("main", "mobs:saddle") then inv:add_item("main", "mobs:saddle") else - minetest.add_item(clicker.getpos(), "mobs:saddle") + minetest.add_item(clicker.get_pos(), "mobs:saddle") end -- attach player to horse diff --git a/mods/mobs_redo/depends.txt b/mods/mobs_redo/depends.txt index 5eb2f17..544ab48 100644 --- a/mods/mobs_redo/depends.txt +++ b/mods/mobs_redo/depends.txt @@ -1,4 +1,5 @@ default +fire invisibility? intllib? lucky_block? diff --git a/mods/mobs_redo/mount.lua b/mods/mobs_redo/mount.lua index b26f8ac..145f5ac 100644 --- a/mods/mobs_redo/mount.lua +++ b/mods/mobs_redo/mount.lua @@ -141,8 +141,8 @@ function mobs.attach(entity, player) default.player_set_animation(player, "sit" , 30) end) - --player:set_look_yaw(entity.object:getyaw() - rot_view) - player:set_look_horizontal(entity.object:getyaw() - rot_view) + --player:set_look_yaw(entity.object:get_yaw() - rot_view) + player:set_look_horizontal(entity.object:get_yaw() - rot_view) end @@ -152,12 +152,12 @@ function mobs.detach(player, offset) default.player_set_animation(player, "stand" , 30) - local pos = player:getpos() + local pos = player:get_pos() pos = {x = pos.x + offset.x, y = pos.y + 0.2 + offset.y, z = pos.z + offset.z} minetest.after(0.1, function() - player:setpos(pos) + player:set_pos(pos) end) end @@ -171,7 +171,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime) end local acce_y = 0 - local velo = entity.object:getvelocity() + local velo = entity.object:get_velocity() entity.v = get_v(velo) * get_sign(entity.v) @@ -198,8 +198,8 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime) end -- fix mob rotation --- entity.object:setyaw(entity.driver:get_look_yaw() - entity.rotate) - entity.object:setyaw(entity.driver:get_look_horizontal() - entity.rotate) +-- entity.object:set_yaw(entity.driver:get_look_yaw() - entity.rotate) + entity.object:set_yaw(entity.driver:get_look_horizontal() - entity.rotate) if can_fly then @@ -259,7 +259,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime) if s ~= get_sign(entity.v) then - entity.object:setvelocity({x = 0, y = 0, z = 0}) + entity.object:set_velocity({x = 0, y = 0, z = 0}) entity.v = 0 return end @@ -276,7 +276,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime) end -- Set position, velocity and acceleration - local p = entity.object:getpos() + local p = entity.object:get_pos() local new_velo = {x = 0, y = 0, z = 0} local new_acce = {x = 0, y = -9.8, z = 0} @@ -330,9 +330,9 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime) end else if math.abs(velo.y) < 1 then - local pos = entity.object:getpos() + local pos = entity.object:get_pos() pos.y = math.floor(pos.y) + 0.5 - entity.object:setpos(pos) + entity.object:set_pos(pos) velo.y = 0 end end @@ -341,11 +341,11 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime) end end - new_velo = get_velocity(v, entity.object:getyaw() - rot_view, velo.y) + new_velo = get_velocity(v, entity.object:get_yaw() - rot_view, velo.y) new_acce.y = new_acce.y + acce_y - entity.object:setvelocity(new_velo) - entity.object:setacceleration(new_acce) + entity.object:set_velocity(new_velo) + entity.object:set_acceleration(new_acce) -- CRASH! if enable_crash then @@ -373,7 +373,7 @@ end function mobs.fly(entity, dtime, speed, shoots, arrow, moving_anim, stand_anim) local ctrl = entity.driver:get_player_control() - local velo = entity.object:getvelocity() + local velo = entity.object:get_velocity() local dir = entity.driver:get_look_dir() -- local yaw = entity.driver:get_look_yaw() local yaw = entity.driver:get_look_horizontal() + 1.57 -- offset fix between old and new commands @@ -384,29 +384,29 @@ function mobs.fly(entity, dtime, speed, shoots, arrow, moving_anim, stand_anim) end if ctrl.up then - entity.object:setvelocity({ + entity.object:set_velocity({ x = dir.x * speed, y = dir.y * speed + 2, z = dir.z * speed }) elseif ctrl.down then - entity.object:setvelocity({ + entity.object:set_velocity({ x = -dir.x * speed, y = dir.y * speed + 2, z = -dir.z * speed }) elseif not ctrl.down or ctrl.up or ctrl.jump then - entity.object:setvelocity({x = 0, y = -2, z = 0}) + entity.object:set_velocity({x = 0, y = -2, z = 0}) end - entity.object:setyaw(yaw + math.pi + math.pi / 2 - entity.rotate) + entity.object:set_yaw(yaw + math.pi + math.pi / 2 - entity.rotate) -- firing arrows if ctrl.LMB and ctrl.sneak and shoots then - local pos = entity.object:getpos() + local pos = entity.object:get_pos() local obj = minetest.add_entity({ x = pos.x + 0 + dir.x * 2.5, y = pos.y + 1.5 + dir.y, @@ -419,8 +419,8 @@ function mobs.fly(entity, dtime, speed, shoots, arrow, moving_anim, stand_anim) local vec = {x = dir.x * 6, y = dir.y * 6, z = dir.z * 6} -- local yaw = entity.driver:get_look_yaw() local yaw = entity.driver:get_look_horizontal() - obj:setyaw(yaw + math.pi / 2) - obj:setvelocity(vec) + obj:set_yaw(yaw + math.pi / 2) + obj:set_velocity(vec) else obj:remove() end diff --git a/mods/mobs_redo/spawner.lua b/mods/mobs_redo/spawner.lua index 11ddfee..a54663d 100644 --- a/mods/mobs_redo/spawner.lua +++ b/mods/mobs_redo/spawner.lua @@ -72,7 +72,7 @@ minetest.register_node("mobs:spawner", { }) -local max_per_block = tonumber(minetest.setting_get("max_objects_per_block") or 99) +local max_per_block = tonumber(minetest.settings:get("max_objects_per_block") or 99) -- spawner abm minetest.register_abm({ diff --git a/mods/paintings/init.lua b/mods/paintings/init.lua index ab2de9f..e471718 100644 --- a/mods/paintings/init.lua +++ b/mods/paintings/init.lua @@ -57,6 +57,7 @@ for _, row in ipairs(paintings) do tiles = { "paintings_"..name..".png", }, + use_texture_alpha = "opaque", visual_scale = 0.5, wield_scale = {x=0.5, y=0.5, z=0.5}, paramtype = "light", @@ -78,7 +79,7 @@ for _, row in ipairs(paintings) do }) end -local easel_formspec = +local easel_formspec = "size[8,9]" .. default.gui_bg .. default.gui_bg_img .. @@ -91,12 +92,13 @@ local easel_formspec = "listring[current_name;output]" .. "listring[current_player;main]" .. default.get_hotbar_bg(0,4.85) - + minetest.register_node("paintings:easel", { description = "Easel", drawtype = "mesh", mesh = "easel.obj", tiles = {"paintings_easel.png"}, + use_texture_alpha = "opaque", paramtype = "light", paramtype2 = "facedir", groups = {choppy=1}, @@ -146,7 +148,7 @@ minetest.register_node("paintings:easel", { inv:set_stack("output", 11, row[12]) inv:set_stack("output", 12, row[13]) end - end + end end end, on_metadata_inventory_take = function(pos, listname, index, stack, player) @@ -155,7 +157,7 @@ minetest.register_node("paintings:easel", { local stack = inv:get_stack("input", 1) local stack_name = stack:get_name() inv:remove_item("input", stack_name.." 1") - + inv:set_stack("output", 1, "") inv:set_stack("output", 2, "") inv:set_stack("output", 3, "") diff --git a/mods/playereffects/init.lua b/mods/playereffects/init.lua index f2fbfa7..13d5d3c 100644 --- a/mods/playereffects/init.lua +++ b/mods/playereffects/init.lua @@ -56,11 +56,11 @@ do if(string ~= nil) then local savetable = minetest.deserialize(string) playereffects.inactive_effects = savetable.inactive_effects - minetest.debug("[playereffects] playereffects.mt successfully read.") - minetest.debug("[playereffects] inactive_effects = "..dump(playereffects.inactive_effects)) + -- minetest.debug("[playereffects] playereffects.mt successfully read.") + -- minetest.debug("[playereffects] inactive_effects = "..dump(playereffects.inactive_effects)) playereffects.last_effect_id = savetable.last_effect_id - minetest.debug("[playereffects] last_effect_id = "..dump(playereffects.last_effect_id)) - + -- minetest.debug("[playereffects] last_effect_id = "..dump(playereffects.last_effect_id)) + end end end @@ -88,7 +88,7 @@ function playereffects.register_effect_type(effect_type_id, description, icon, g effect_type.hidden = false end if cancel_on_death ~= nil then - effect_type.cancel_on_death = cancel_on_death + effect_type.cancel_on_death = cancel_on_death else effect_type.cancel_on_death = true end @@ -180,7 +180,7 @@ function playereffects.apply_effect_type(effect_type_id, duration, player, repea end local effect = { - playername = playername, + playername = playername, effect_id = effect_id, effect_type_id = effect_type_id, start_time = start_time, @@ -295,7 +295,7 @@ function playereffects.get_player_effects(playername) end return effects else - return {} + return {} end end @@ -410,7 +410,7 @@ minetest.register_globalstep(function(dtime) -- Update HUDs of all players if(playereffects.globalstep_timer >= 1) then playereffects.globalstep_timer = 0 - + local players = minetest.get_connected_players() for p=1,#players do playereffects.hud_update(players[p]) @@ -496,7 +496,7 @@ function playereffects.hud_effect(effect_type_id, player, pos, time_left, repeat alignment = { x = -1, y = 0 }, direction = 1, number = color, - offset = { x = -5, y = pos*20 } + offset = { x = -5, y = pos*20 } }) if(playereffects.effect_types[effect_type_id].icon ~= nil) then icon_id = player:hud_add({ @@ -509,7 +509,7 @@ function playereffects.hud_effect(effect_type_id, player, pos, time_left, repeat direction = 0, offset = { x = -186, y = pos*20 }, }) - end + end else text_id = nil icon_id = nil diff --git a/mods/screwdriver/init.lua b/mods/screwdriver/init.lua index e73b618..6bcc9f6 100644 --- a/mods/screwdriver/init.lua +++ b/mods/screwdriver/init.lua @@ -81,7 +81,7 @@ screwdriver.handler = function(itemstack, user, pointed_thing, mode, uses) minetest.swap_node(pos, node) end - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then itemstack:add_wear(65535 / ((uses or 200) - 1)) end diff --git a/mods/sethome/init.lua b/mods/sethome/init.lua index e0fc453..100664d 100644 --- a/mods/sethome/init.lua +++ b/mods/sethome/init.lua @@ -52,7 +52,7 @@ end sethome.go = function(name) local player = minetest.get_player_by_name(name) if player and homepos[name] then - player:setpos(homepos[name]) + player:set_pos(homepos[name]) return true end return false @@ -80,7 +80,7 @@ minetest.register_chatcommand("sethome", { func = function(name) name = name or "" -- fallback to blank name if nil local player = minetest.get_player_by_name(name) - if player and sethome.set(name, player:getpos()) then + if player and sethome.set(name, player:get_pos()) then return true, "Home set!" end return false, "Player not found!" diff --git a/mods/stairs/depends.txt b/mods/stairs/depends.txt index d77ba25..2175092 100644 --- a/mods/stairs/depends.txt +++ b/mods/stairs/depends.txt @@ -1,2 +1,3 @@ default farming +mapgen diff --git a/mods/stairs/init.lua b/mods/stairs/init.lua index 00e8f6a..54c1f3e 100644 --- a/mods/stairs/init.lua +++ b/mods/stairs/init.lua @@ -22,7 +22,7 @@ local function rotate_and_place(itemstack, placer, pointed_thing) local p1 = pointed_thing.above local param2 = 0 - local placer_pos = placer:getpos() + local placer_pos = placer:get_pos() if placer_pos then param2 = minetest.dir_to_facedir(vector.subtract(p1, placer_pos)) end @@ -52,6 +52,7 @@ function stairs.register_stair(subname, recipeitem, groups, images, description, drawtype = "mesh", mesh = "stairs_stair.obj", tiles = images, + use_texture_alpha = recipeitem and minetest.registered_items[recipeitem].use_texture_alpha or "opaque", paramtype = "light", paramtype2 = "facedir", is_ground_content = false, @@ -137,6 +138,7 @@ function stairs.register_slab(subname, recipeitem, groups, images, description, description = description, drawtype = "nodebox", tiles = images, + use_texture_alpha = recipeitem and minetest.registered_items[recipeitem].use_texture_alpha or "opaque", paramtype = "light", paramtype2 = "facedir", is_ground_content = false, @@ -650,4 +652,4 @@ stairs.register_stair_and_slab( "Palm Wood Stair", "Palm Wood Slab", default.node_sound_wood_defaults() -) \ No newline at end of file +) diff --git a/mods/stm_nodes/init.lua b/mods/stm_nodes/init.lua index 836f165..36c6111 100644 --- a/mods/stm_nodes/init.lua +++ b/mods/stm_nodes/init.lua @@ -60,6 +60,7 @@ minetest.register_node("stm_nodes:silo", { tiles = { "stm_nodes_silo.png", }, + use_texture_alpha = "opaque", drawtype = "mesh", mesh = "silo.obj", paramtype = "light", @@ -72,7 +73,7 @@ minetest.register_node("stm_nodes:silo", { collision_box = { type = "fixed", fixed = { - {-0.5, -0.5, -0.5, 1.5, 2.8, 1.5}, + {-0.5, -0.5, -0.5, 1.5, 2.8, 1.5}, } }, groups = {cracky = 1}, @@ -117,6 +118,7 @@ minetest.register_node("stm_nodes:hopper", { "stm_nodes_hopper.png", "stm_nodes_hopper.png" }, + use_texture_alpha = "opaque", drawtype = "nodebox", paramtype = "light", node_box = { @@ -338,8 +340,9 @@ minetest.register_node("stm_nodes:porthole", { "stm_nodes_block.png", "stm_nodes_block.png", "stm_nodes_porthole.png", - "stm_nodes_porthole.png" + "stm_nodes_porthole.png", }, + use_texture_alpha = "clip", drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", @@ -365,8 +368,8 @@ minetest.register_node("stm_nodes:porthole", { {-0.1875, -0.1875, 0.375, 0.1875, 0.1875, 0.375}, -- NodeBox18 } }, - sounds = default.node_sound_metal_defaults, - groups = {cracky=1, snappy=1} + sounds = default.node_sound_metal_defaults(), + groups = {cracky=1, snappy=1}, }) minetest.register_node("stm_nodes:tank", { @@ -379,6 +382,7 @@ minetest.register_node("stm_nodes:tank", { "stm_nodes_boiler.png", "stm_nodes_boiler_pipe.png", }, + use_texture_alpha = "opaque", drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", @@ -407,6 +411,7 @@ minetest.register_node("stm_nodes:tank2", { "stm_nodes_boiler2.png", "stm_nodes_boiler_pipe2.png" }, + use_texture_alpha = "opaque", drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", @@ -520,7 +525,7 @@ minetest.register_abm({ chance = 1, action = function(pos, node) local active = true - + local steam_input = minetest.find_node_near(pos, 1, {"stm_nodes:pipe"}) local source = minetest.get_node({x=pos.x, y=pos.y-3, z=pos.z}) local source2 = minetest.get_node({x=pos.x, y=pos.y-2, z=pos.z}) @@ -528,16 +533,16 @@ minetest.register_abm({ active = false steam_input = minetest.find_node_near(pos, 1, {"stm_nodes:pipe_active"}) end - + if not minetest.find_node_near(pos, 2, {"stm_nodes:boiler", "stm_nodes:large_boiler_top"}) then - active = false + active = false steam_input = minetest.find_node_near(pos, 1, {"stm_nodes:pipe_active"}) end - - if steam_input == nil then - return + + if steam_input == nil then + return end - + if not active then for i = 1, 20 do local name = minetest.get_node(steam_input).name @@ -546,14 +551,14 @@ minetest.register_abm({ end local nextpos = minetest.find_node_near(steam_input, 1, {"stm_nodes:pipe_active",}) if not nextpos then - return + return end steam_input = nextpos end - return + return end - - + + for i = 1, 20 do local name = minetest.get_node(steam_input).name if name == "stm_nodes:pipe" then @@ -561,7 +566,7 @@ minetest.register_abm({ end local nextpos = minetest.find_node_near(steam_input, 1, {"stm_nodes:pipe",}) if not nextpos then - return + return end steam_input = nextpos end @@ -740,6 +745,7 @@ minetest.register_node("stm_nodes:compressor_open", { "stm_nodes_compressor_side.png", "stm_nodes_compressor_side.png" }, + use_texture_alpha = "opaque", drawtype = "nodebox", paramtype = "light", node_box = { @@ -826,6 +832,7 @@ minetest.register_node("stm_nodes:compressor_closed", { "stm_nodes_compressor_side.png", "stm_nodes_compressor_side.png" }, + use_texture_alpha = "opaque", drawtype = "nodebox", paramtype = "light", node_box = { @@ -863,6 +870,7 @@ minetest.register_node("stm_nodes:lever_open", { "stm_nodes_lever_back.png", "stm_nodes_lever_front.png" }, + use_texture_alpha = "opaque", drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", @@ -908,6 +916,7 @@ minetest.register_node("stm_nodes:lever_closed", { "stm_nodes_lever_back.png", "stm_nodes_lever_front2.png" }, + use_texture_alpha = "opaque", drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", @@ -932,6 +941,7 @@ minetest.register_node("stm_nodes:cable", { tiles = { "stm_nodes_cable.png", }, + use_texture_alpha = "opaque", drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", @@ -963,6 +973,7 @@ minetest.register_node("stm_nodes:cable", { minetest.register_node("stm_nodes:cable_active", { tiles = {"stm_nodes_cable.png"}, + use_texture_alpha = "opaque", drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", @@ -996,6 +1007,7 @@ minetest.register_node("stm_nodes:cable_active", { minetest.register_node("stm_nodes:cable_ceiling", { description = "Ceiling Cable", tiles = {"stm_nodes_cable.png"}, + use_texture_alpha = "opaque", drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", @@ -1029,6 +1041,7 @@ minetest.register_node("stm_nodes:cable_ceiling_active", { tiles = { "stm_nodes_cable.png", }, + use_texture_alpha = "opaque", drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", @@ -1068,16 +1081,16 @@ minetest.register_abm({ if sustainer then minetest.set_node(sustainer, {name="stm_nodes:sustainer"}) end]] - + local nodename = minetest.get_node(pos).name local newname = "stm_nodes:cable_ceiling" if nodename == "stm_nodes:cable_active" then newname = "stm_nodes:cable" end - + local cable = minetest.find_node_near(pos, 1, {"stm_nodes:cable", "stm_nodes:cable_active", "stm_nodes:cable_ceiling", "stm_nodes:cable_ceiling_active"}) local power = minetest.find_node_near(pos, 10, {"stm_nodes:generator_active", "stm_nodes:sustainer"}) - if not cable then + if not cable then minetest.set_node(pos, {name=newname, param2=node.param2}) elseif not power then minetest.set_node(pos, {name=newname, param2=node.param2}) @@ -1106,7 +1119,7 @@ minetest.register_node("stm_nodes:incinerator", { {-0.375, -0.5, -0.375, 0.375, 0.5, 0.375}, -- NodeBox3 {-0.125, 0.5, -0.0625, 0.125, 1.5, 0.1875}, -- NodeBox4 } - }, + }, groups = {cracky=1}, sounds = default.node_sound_metal_defaults(), on_rightclick = function(pos, node, clicker, itemstack) @@ -1303,6 +1316,7 @@ minetest.register_node("stm_nodes:barrel", { "stm_nodes_barrel.png", "stm_nodes_barrel.png" }, + use_texture_alpha = "opaque", drawtype = "nodebox", paramtype = "light", node_box = { @@ -1341,6 +1355,7 @@ minetest.register_node("stm_nodes:lever2_off", { tiles = { "stm_nodes_plate.png", }, + use_texture_alpha = "opaque", drawtype = "nodebox", paramtype = "light", node_box = { @@ -1363,6 +1378,7 @@ minetest.register_node("stm_nodes:lever2_on", { tiles = { "stm_nodes_plate.png", }, + use_texture_alpha = "opaque", drawtype = "nodebox", paramtype = "light", node_box = { @@ -1392,6 +1408,7 @@ minetest.register_node("stm_nodes:big_vent", { "stm_nodes_block.png", "stm_nodes_vent.png" }, + use_texture_alpha = "opaque", drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", @@ -1561,6 +1578,7 @@ minetest.register_node("stm_nodes:large_boiler_base", { "stm_nodes_lboiler_bottom.png", "stm_nodes_lboiler.png^[transformFY", }, + use_texture_alpha = "opaque", drawtype = "nodebox", paramtype = "light", node_box = { @@ -1598,6 +1616,7 @@ minetest.register_node("stm_nodes:large_boiler_top", { "stm_nodes_lboiler_top.png", "stm_nodes_lboiler.png", }, + use_texture_alpha = "opaque", drawtype = "nodebox", paramtype = "light", node_box = { @@ -1630,6 +1649,7 @@ minetest.register_node("stm_nodes:boiler_output", { "stm_nodes_graveller_front.png", "stm_nodes_boiler_output.png", }, + use_texture_alpha = "opaque", drawtype = "nodebox", paramtype = "light", node_box = { @@ -1670,6 +1690,7 @@ minetest.register_node("stm_nodes:motor", { "stm_nodes_motor_front.png", "stm_nodes_motor_front.png" }, + use_texture_alpha = "opaque", drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", @@ -1720,7 +1741,7 @@ minetest.register_node("stm_nodes:light", { light_source = 13, drop = "stm_nodes:light_off", groups = {cracky=1, electric=2}, - sounds = default.node_sound_metal_defaults() + sounds = default.node_sound_metal_defaults() }) minetest.register_node("stm_nodes:light_off", { @@ -1773,7 +1794,7 @@ minetest.register_node("stm_nodes:sustainer", { }, drop = "stm_nodes:sustainer_inactive", groups = {cracky=1, electric=2}, - sounds = default.node_sound_metal_defaults() + sounds = default.node_sound_metal_defaults() }) minetest.register_node("stm_nodes:sustainer_inactive", { @@ -1787,7 +1808,7 @@ minetest.register_node("stm_nodes:sustainer_inactive", { "stm_nodes_sustainer.png" }, groups = {cracky=1, electric=2}, - sounds = default.node_sound_metal_defaults() + sounds = default.node_sound_metal_defaults() }) minetest.register_abm({ @@ -1905,12 +1926,12 @@ minetest.register_abm({ minetest.set_node(pos, {name="stm_nodes:sustainer_inactive"}) return end - + local power = minetest.find_node_near(pos, 1, {"stm_nodes:cable", "stm_nodes:cable_ceiling"}) if not power then - return + return end - + for i = 1, 11 do local name = minetest.get_node(power).name if name == "stm_nodes:cable" then @@ -1920,7 +1941,7 @@ minetest.register_abm({ end local nextpos = minetest.find_node_near(power, 1, {"stm_nodes:cable", "stm_nodes:cable_ceiling"}) if not nextpos then - return + return end power = nextpos end @@ -1965,7 +1986,7 @@ minetest.register_abm({ return end if obj:get_luaentity() ~= nil then local dir = minetest.facedir_to_dir(node.param2) - obj:setvelocity({x=2*dir.x, y=2*dir.y, z=2*dir.z}) + obj:set_velocity({x=2*dir.x, y=2*dir.y, z=2*dir.z}) end end end @@ -2026,7 +2047,7 @@ minetest.register_abm({ chance = 1, action = function(pos, node) if minetest.find_node_near(pos, 1, {"stm_nodes:lever2_off",}) then - return + return end local power = minetest.find_node_near(pos, 1, {"stm_nodes:cable_active", "stm_nodes:cable_ceiling_active",}) if power then @@ -2110,7 +2131,7 @@ minetest.register_abm({ chance = 1, action = function(pos, node) if minetest.find_node_near(pos, 1, {"stm_nodes:lever2_off",}) then - return + return end local power = minetest.find_node_near(pos, 1, {"stm_nodes:cable_active", "stm_nodes:cable_ceiling_active",}) if power then @@ -2162,7 +2183,7 @@ minetest.register_node("stm_nodes:bulb", { drawtype = "plantlike", paramtype = "light", --light_source = 5, - use_texture_alpha = true, + use_texture_alpha = "clip", groups = {cracky=1, oddly_breakeable_by_hand=1, electric=1}, selection_box = { type = "fixed", @@ -2190,7 +2211,7 @@ minetest.register_node("stm_nodes:bulb_active", { drawtype = "plantlike", paramtype = "light", light_source = 8, - use_texture_alpha = true, + use_texture_alpha = "blend", groups = {cracky=1, oddly_breakeable_by_hand=1, electric=1}, sounds = default.node_sound_glass_defaults(), on_rightclick = function(pos, node) @@ -2209,4 +2230,4 @@ minetest.register_node("stm_nodes:bulb_active", { } }, drop = "stm_nodes:bulb", -}) \ No newline at end of file +}) diff --git a/mods/tnt/init.lua b/mods/tnt/init.lua index 6af7740..9ab6b33 100644 --- a/mods/tnt/init.lua +++ b/mods/tnt/init.lua @@ -1,7 +1,7 @@ tnt = {} -- Default to enabled when in singleplayer -local enable_tnt = minetest.setting_getbool("enable_tnt") +local enable_tnt = minetest.settings:get_bool("enable_tnt") if enable_tnt == nil then enable_tnt = minetest.is_singleplayer() end @@ -12,7 +12,7 @@ local loss_prob = {} loss_prob["default:cobble"] = 3 loss_prob["default:dirt"] = 4 -local tnt_radius = tonumber(minetest.setting_get("tnt_radius") or 3) +local tnt_radius = tonumber(minetest.settings:get("tnt_radius") or 3) -- Fill a list with data for content IDs, after all nodes are registered local cid_data = {} @@ -58,8 +58,8 @@ local function eject_drops(drops, pos, radius) local obj = minetest.add_item(drop_pos, dropitem) if obj then obj:get_luaentity().collect = true - obj:setacceleration({x = 0, y = -10, z = 0}) - obj:setvelocity({x = math.random(-3, 3), + obj:set_acceleration({x = 0, y = -10, z = 0}) + obj:set_velocity({x = math.random(-3, 3), y = math.random(0, 10), z = math.random(-3, 3)}) end @@ -142,7 +142,7 @@ end local function entity_physics(pos, radius, drops) local objs = minetest.get_objects_inside_radius(pos, radius) for _, obj in pairs(objs) do - local obj_pos = obj:getpos() + local obj_pos = obj:get_pos() local dist = math.max(1, vector.distance(pos, obj_pos)) local damage = (4 / dist) * radius @@ -154,7 +154,7 @@ local function entity_physics(pos, radius, drops) local moveoff = vector.multiply(dir, dist + 1.0) local newpos = vector.add(pos, moveoff) newpos = vector.add(newpos, {x = 0, y = 0.2, z = 0}) - obj:setpos(newpos) + obj:set_pos(newpos) obj:set_hp(obj:get_hp() - damage) else @@ -169,8 +169,8 @@ local function entity_physics(pos, radius, drops) end if do_knockback then - local obj_vel = obj:getvelocity() - obj:setvelocity(calc_velocity(pos, obj_pos, + local obj_vel = obj:get_velocity() + obj:set_velocity(calc_velocity(pos, obj_pos, obj_vel, radius * 10)) end if do_damage then diff --git a/mods/tools/init.lua b/mods/tools/init.lua index 7124ce1..3918935 100644 --- a/mods/tools/init.lua +++ b/mods/tools/init.lua @@ -4,7 +4,7 @@ minetest.register_globalstep(function() if player:get_player_name() ~= "singleplayer" then return end local item = player:get_wielded_item():get_name() if item == "default:torch" or item == "decoblocks:lantern" then - local pos = player:getpos() + local pos = player:get_pos() pos.y = pos.y+1.2 if minetest.get_node(pos).name == "air" then minetest.set_node(pos, {name="tools:light"}) @@ -44,7 +44,7 @@ minetest.register_craftitem("tools:watering_can", { on_use = function(item, placer, pointed_thing) if pointed_thing.under == nil then return end local dir = placer:get_look_dir() - local pos1 = placer:getpos() + local pos1 = placer:get_pos() local pos = pointed_thing.under for i=1,10 do minetest.add_particle({ diff --git a/mods/vehicles/api.lua b/mods/vehicles/api.lua index a3ae5d9..4980e5a 100644 --- a/mods/vehicles/api.lua +++ b/mods/vehicles/api.lua @@ -57,21 +57,21 @@ function vehicles.object_attach(entity, player, attach_at, visible, eye_offset) minetest.after(0.2, function() default.player_set_animation(player, "sit" , 30) end) - entity.object:setyaw(player:get_look_yaw() - math.pi / 2) + entity.object:set_yaw(player:get_look_yaw() - math.pi / 2) end function vehicles.object_detach(entity, player, offset) entity.driver = nil - entity.object:setvelocity({x=0, y=0, z=0}) + entity.object:set_velocity({x=0, y=0, z=0}) player:set_detach() default.player_attached[player:get_player_name()] = false default.player_set_animation(player, "stand" , 30) player:set_properties({visual_size = {x=1, y=1}}) player:set_eye_offset({x=0, y=0, z=0}, {x=0, y=0, z=0}) - local pos = player:getpos() + local pos = player:get_pos() pos = {x = pos.x + offset.x, y = pos.y + 0.2 + offset.y, z = pos.z + offset.z} minetest.after(0.1, function() - player:setpos(pos) + player:set_pos(pos) end) end ------------------------------------------------------------------------------- @@ -154,12 +154,12 @@ function vehicles.object_drive(entity, dtime, def) --variables local ctrl = entity.driver:get_player_control() - local velo = entity.object:getvelocity() + local velo = entity.object:get_velocity() local dir = entity.driver:get_look_dir(); local vec_backward = {x=-dir.x*speed/4,y=velo.y+1*-2,z=-dir.z*speed/4} local vec_stop = {x=velo.x*decell,y=velo.y+1*-2,z=velo.z*decell} local yaw = entity.driver:get_look_yaw(); - local pos = entity.object:getpos() + local pos = entity.object:get_pos() local node = minetest.get_node(pos).name local node_under = minetest.get_node({x=pos.x, y=pos.y+2, z=pos.z}) local accell = 1 @@ -273,20 +273,20 @@ function vehicles.object_drive(entity, dtime, def) --face the right way local target_yaw = yaw+math.pi+math.pi/2+extra_yaw - local entity_yaw = entity.object:getyaw() + local entity_yaw = entity.object:get_yaw() local change_yaw = (((target_yaw-entity_yaw+math.pi)%(math.pi*2))-math.pi)/(turning_factor*absolute_speed+1) if entity_yaw ~= target_yaw and not uses_arrow_keys then - entity.object:setyaw(entity_yaw+change_yaw) + entity.object:set_yaw(entity_yaw+change_yaw) dir.x = -math.sin(entity_yaw) dir.z = math.cos(entity_yaw) else --minetest.chat_send_all("yaw:"..entity_yaw) --minetest.chat_send_all("dirx: "..dir.x.." dirz:"..dir.z) if ctrl.left then - entity.object:setyaw(entity_yaw+(math.pi/360)*absolute_speed/2) + entity.object:set_yaw(entity_yaw+(math.pi/360)*absolute_speed/2) end if ctrl.right then - entity.object:setyaw(entity_yaw-(math.pi/360)*absolute_speed/2) + entity.object:set_yaw(entity_yaw-(math.pi/360)*absolute_speed/2) end dir.x = -math.sin(entity_yaw) dir.z = math.cos(entity_yaw) @@ -311,11 +311,11 @@ function vehicles.object_drive(entity, dtime, def) --apply water effects if is_watercraft and entity.in_water then - entity.object:setvelocity({x=velo.x*0.9, y=velo.y+1, z=velo.z*0.9}) + entity.object:set_velocity({x=velo.x*0.9, y=velo.y+1, z=velo.z*0.9}) elseif is_watercraft and entity.on_water == false then - entity.object:setvelocity({x=velo.x*decell,y=velo.y-1,z=velo.z*decell}) + entity.object:set_velocity({x=velo.x*decell,y=velo.y-1,z=velo.z*decell}) elseif (entity.on_water or entity.in_water) and not is_watercraft then - entity.object:setvelocity({x=velo.x*0.9, y=-1, z=velo.z*0.9}) + entity.object:set_velocity({x=velo.x*0.9, y=-1, z=velo.z*0.9}) --brakes elseif ctrl.jump and brakes and not ctrl.up then @@ -324,7 +324,7 @@ function vehicles.object_drive(entity, dtime, def) velo2 = velo end local effect_pos = {x=pos.x-dir.x*2, y=pos.y, z=pos.z-dir.z*2} - entity.object:setvelocity({x=velo2.x*(0.95), y=velo.y, z=velo2.z*(0.95)}) + entity.object:set_velocity({x=velo2.x*(0.95), y=velo.y, z=velo2.z*(0.95)}) minetest.add_particlespawner( 4, --amount 0.5, --time @@ -350,7 +350,7 @@ function vehicles.object_drive(entity, dtime, def) velo3 = velo end local effect_pos = {x=pos.x-dir.x*2, y=pos.y, z=pos.z-dir.z*2} - entity.object:setvelocity({x=velo.x*(decell), y=velo.y, z=velo.z*(decell)}) + entity.object:set_velocity({x=velo.x*(decell), y=velo.y, z=velo.z*(decell)}) minetest.add_particlespawner( 4, --amount 0.5, --time @@ -373,7 +373,7 @@ function vehicles.object_drive(entity, dtime, def) --boost elseif ctrl.up and not shoots2 and ctrl.aux1 and entity.boost then - entity.object:setvelocity({x=dir.x*(speed*0.2)*math.log(timer+0.5)+8*dir.x,y=velo.y-gravity/2,z=dir.z*(speed*0.2)*math.log(timer+0.5)+8*dir.z}) + entity.object:set_velocity({x=dir.x*(speed*0.2)*math.log(timer+0.5)+8*dir.x,y=velo.y-gravity/2,z=dir.z*(speed*0.2)*math.log(timer+0.5)+8*dir.z}) if boost_effect ~= nil then local effect_pos = {x=pos.x-dir.x*2, y=pos.y, z=pos.z-dir.z*2} minetest.add_particlespawner( @@ -403,7 +403,7 @@ function vehicles.object_drive(entity, dtime, def) end --rise elseif ctrl.jump and fly and fly_mode == "rise" then - entity.object:setvelocity(vec_rise) + entity.object:set_velocity(vec_rise) --lib_mount animation if moving_anim ~= nil and not entity.moving then entity.object:set_animation(moving_anim, anim_speed, 0) @@ -411,15 +411,15 @@ function vehicles.object_drive(entity, dtime, def) end --hover in place elseif ctrl.jump and ctrl.up and fly and fly_mode == "hold" then - entity.object:setvelocity({x=dir.x*speed, y=0, z=dir.z*speed}) + entity.object:set_velocity({x=dir.x*speed, y=0, z=dir.z*speed}) --move forward elseif ctrl.up and not fixed then if not fly and not is_watercraft then - entity.object:setvelocity({x=(dir.x*(speed*0.2)*math.log(timer+0.5)+4*dir.x)/(braking*(0.1)+1),y=velo.y-0.5,z=(dir.z*(speed*0.2)*math.log(timer+0.5)+4*dir.z)/(braking*(0.1)+1)}) + entity.object:set_velocity({x=(dir.x*(speed*0.2)*math.log(timer+0.5)+4*dir.x)/(braking*(0.1)+1),y=velo.y-0.5,z=(dir.z*(speed*0.2)*math.log(timer+0.5)+4*dir.z)/(braking*(0.1)+1)}) elseif not fly then - entity.object:setvelocity({x=dir.x*(speed*0.2)*math.log(timer+0.5)+4*dir.x,y=0,z=dir.z*(speed*0.2)*math.log(timer+0.5)+4*dir.z}) + entity.object:set_velocity({x=dir.x*(speed*0.2)*math.log(timer+0.5)+4*dir.x,y=0,z=dir.z*(speed*0.2)*math.log(timer+0.5)+4*dir.z}) else - entity.object:setvelocity({x=dir.x*(speed*0.2)*math.log(timer+0.5)+4*dir.x,y=dir.y*(speed*0.2)*math.log(timer+0.5)+4*dir.y+1,z=dir.z*(speed*0.2)*math.log(timer+0.5)+4*dir.z}) + entity.object:set_velocity({x=dir.x*(speed*0.2)*math.log(timer+0.5)+4*dir.x,y=dir.y*(speed*0.2)*math.log(timer+0.5)+4*dir.y+1,z=dir.z*(speed*0.2)*math.log(timer+0.5)+4*dir.z}) end --animation if moving_anim ~= nil and not entity.moving and not hovering then @@ -435,7 +435,7 @@ function vehicles.object_drive(entity, dtime, def) velo2 = velo end local effect_pos = {x=pos.x-dir.x*2, y=pos.y, z=pos.z-dir.z*2} - entity.object:setvelocity({x=velo2.x*(0.95), y=velo.y, z=velo2.z*(0.95)}) + entity.object:set_velocity({x=velo2.x*(0.95), y=velo.y, z=velo2.z*(0.95)}) minetest.add_particlespawner( 4, --amount 0.5, --time @@ -456,7 +456,7 @@ function vehicles.object_drive(entity, dtime, def) timer = timer-timer/10 end else - entity.object:setvelocity({x=-dir.x*(speed/4)*accell,y=velo.y-0.5,z=-dir.z*(speed/4)*accell}) + entity.object:set_velocity({x=-dir.x*(speed/4)*accell,y=velo.y-0.5,z=-dir.z*(speed/4)*accell}) end else if brakes and absolute_speed > 5 then @@ -465,7 +465,7 @@ function vehicles.object_drive(entity, dtime, def) velo2 = velo end local effect_pos = {x=pos.x-dir.x*2, y=pos.y, z=pos.z-dir.z*2} - entity.object:setvelocity({x=velo2.x*(0.95), y=velo.y, z=velo2.z*(0.95)}) + entity.object:set_velocity({x=velo2.x*(0.95), y=velo.y, z=velo2.z*(0.95)}) minetest.add_particlespawner( 4, --amount 0.5, --time @@ -486,7 +486,7 @@ function vehicles.object_drive(entity, dtime, def) timer = timer-timer/10 end else - entity.object:setvelocity({x=-dir.x*(speed/4)*accell,y=0,z=-dir.z*(speed/4)*accell}) + entity.object:set_velocity({x=-dir.x*(speed/4)*accell,y=0,z=-dir.z*(speed/4)*accell}) end end --animation @@ -496,7 +496,7 @@ function vehicles.object_drive(entity, dtime, def) end --stop elseif not ctrl.down or ctrl.up then - entity.object:setvelocity({x=velo.x*decell,y=velo.y-gravity,z=velo.z*decell}) + entity.object:set_velocity({x=velo.x*decell,y=velo.y-gravity,z=velo.z*decell}) --animation if moving_anim ~= nil and entity.moving and not hovering then entity.object:set_animation(stand_anim, anim_speed, 0) @@ -510,8 +510,8 @@ function vehicles.object_drive(entity, dtime, def) entity.loaded = false local obj = minetest.env:add_entity({x=pos.x+0+dir.x*2,y=pos.y+shoot_y+dir.y,z=pos.z+0+dir.z*2}, arrow) local vec = {x=dir.x*14,y=dir.y*14+shoot_angle,z=dir.z*14} - obj:setyaw(yaw+math.pi/2+extra_yaw) - obj:setvelocity(vec) + obj:set_yaw(yaw+math.pi/2+extra_yaw) + obj:set_velocity(vec) local object = obj:get_luaentity() object.launcher = entity.driver object.vehicle = entity.object @@ -534,8 +534,8 @@ function vehicles.object_drive(entity, dtime, def) entity.loaded2 = false local obj = minetest.env:add_entity({x=pos.x+0+dir.x*2,y=pos.y+shoot_y2+dir.y,z=pos.z+0+dir.z*2}, arrow2) local vec = {x=dir.x*20,y=dir.y*20+shoot_angle,z=dir.z*20} - obj:setyaw(yaw+math.pi/2+extra_yaw) - obj:setvelocity(vec) + obj:set_yaw(yaw+math.pi/2+extra_yaw) + obj:set_velocity(vec) local object = obj:get_luaentity() object.launcher = entity.driver object.vehicle = entity.object @@ -555,9 +555,9 @@ function vehicles.object_drive(entity, dtime, def) if jump == "hover" and ctrl.jump and not entity.jumpcharge then if not ctrl.up then local vec_hover = {x=velo.x+0,y=hover_speed,z=velo.z+0} - entity.object:setvelocity(vec_hover) + entity.object:set_velocity(vec_hover) else - entity.object:setvelocity({x=dir.x*(speed*0.2)*math.log(timer+0.5)+4*dir.x,y=hover_speed,z=dir.z*(speed*0.2)*math.log(timer+0.5)+4*dir.z}) + entity.object:set_velocity({x=dir.x*(speed*0.2)*math.log(timer+0.5)+4*dir.x,y=hover_speed,z=dir.z*(speed*0.2)*math.log(timer+0.5)+4*dir.z}) end hovering = true if jump_anim ~= nil and entity.object:get_animation().range ~= jump_anim and hovering then @@ -575,9 +575,9 @@ function vehicles.object_drive(entity, dtime, def) if jump == "jump" and ctrl.jump and not entity.jumpcharge then if not ctrl.up then local vec_jump = {x=velo.x+0,y=jump_speed,z=velo.z+0} - entity.object:setvelocity(vec_jump) + entity.object:set_velocity(vec_jump) else - entity.object:setvelocity({x=dir.x*speed/4*math.atan(0.5*timer-2)+8*dir.x,y=jump_speed,z=dir.z*speed/4*math.atan(0.5*timer-2)+8*dir.z}) + entity.object:set_velocity({x=dir.x*speed/4*math.atan(0.5*timer-2)+8*dir.x,y=jump_speed,z=dir.z*speed/4*math.atan(0.5*timer-2)+8*dir.z}) end hovering = true if jump_anim ~= nil and entity.object:get_animation().range ~= jump_anim and hovering then @@ -608,41 +608,41 @@ end function vehicles.object_drive_simple(entity, dtime, speed, decell) local ctrl = entity.driver:get_player_control() - local velo = entity.object:getvelocity() + local velo = entity.object:get_velocity() local dir = entity.driver:get_look_dir(); local vec_forward = {x=dir.x*speed,y=velo.y+1*-2,z=dir.z*speed} local vec_backward = {x=-dir.x*speed,y=velo.y+1*-2,z=-dir.z*speed} local vec_stop = {x=velo.x*decell,y=velo.y+1*-2,z=velo.z*decell} local yaw = entity.driver:get_look_yaw(); - entity.object:setyaw(yaw+math.pi+math.pi/2) + entity.object:set_yaw(yaw+math.pi+math.pi/2) if ctrl.up then - entity.object:setvelocity(vec_forward) + entity.object:set_velocity(vec_forward) elseif ctrl.down then - entity.object:setvelocity(vec_backward) + entity.object:set_velocity(vec_backward) elseif not ctrl.down or ctrl.up then - entity.object:setvelocity(vec_stop) + entity.object:set_velocity(vec_stop) end end function vehicles.object_glide(entity, dtime, speed, decell, gravity, moving_anim, stand_anim) local ctrl = entity.driver:get_player_control() local dir = entity.driver:get_look_dir(); - local velo = entity.object:getvelocity(); + local velo = entity.object:get_velocity(); local vec_glide = {x=dir.x*speed*decell, y=velo.y, z=dir.z*speed*decell} local yaw = entity.driver:get_look_yaw(); if not ctrl.sneak then - entity.object:setyaw(yaw+math.pi+math.pi/2) - entity.object:setvelocity(vec_glide) - entity.object:setacceleration({x=0, y=gravity, z=0}) + entity.object:set_yaw(yaw+math.pi+math.pi/2) + entity.object:set_velocity(vec_glide) + entity.object:set_acceleration({x=0, y=gravity, z=0}) end if ctrl.sneak then local vec = {x=0,y=gravity*15,z=0} local yaw = entity.driver:get_look_yaw(); - entity.object:setyaw(yaw+math.pi+math.pi/2) - entity.object:setvelocity(vec) + entity.object:set_yaw(yaw+math.pi+math.pi/2) + entity.object:set_velocity(vec) end if velo.y == 0 then - local pos = entity.object:getpos() + local pos = entity.object:get_pos() for dx=-1,1 do for dy=-1,1 do for dz=-1,1 do @@ -650,7 +650,7 @@ function vehicles.object_glide(entity, dtime, speed, decell, gravity, moving_ani local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} local n = minetest.env:get_node(p).name if n ~= "massdestruct:parachute" and n ~= "air" then - local pos = entity.object:getpos() + local pos = entity.object:get_pos() entity.object:remove() return end @@ -668,21 +668,21 @@ minetest.register_craftitem(vehicle.."_spawner", { wield_scale = {x = 1.5, y = 1.5, z = 1}, on_place = function(item, placer, pointed_thing) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); if pointed_thing.type == "node" and not is_boat then local obj = minetest.env:add_entity(pointed_thing.above, vehicle) local object = obj:get_luaentity() object.owner = placer - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then item:take_item() return item end elseif pointed_thing.type == "node" and minetest.get_item_group(pointed_thing.name, "water") then local obj = minetest.env:add_entity(pointed_thing.under, vehicle) - obj:setvelocity({x=0, y=-1, z=0}) + obj:set_velocity({x=0, y=-1, z=0}) local object = obj:get_luaentity() object.owner = placer - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then item:take_item() return item end @@ -692,7 +692,7 @@ minetest.register_craftitem(vehicle.."_spawner", { end function vehicles.explodinate(ent, radius) - local pos = ent.object:getpos() + local pos = ent.object:get_pos() minetest.add_particle({ pos = {x=pos.x, y=pos.y, z=pos.z}, velocity = {x=0, y=1, z=0}, @@ -778,7 +778,7 @@ function vehicles.on_punch(self, puncher) local creative_mode = creative and creative.is_enabled_for and creative.is_enabled_for(self.driver:get_player_name()) if self.driver == puncher and (hp == self.hp_max-5 or hp == self.hp_max or creative_mode) then local name = self.object:get_luaentity().name - local pos = self.object:getpos() + local pos = self.object:get_pos() minetest.env:add_item(pos, name.."_spawner") vehicles.object_detach(self, self.driver, {x=1, y=0, z=1}) self.object:remove() @@ -793,8 +793,8 @@ function vehicles.object_no_drive(entity, dtime, def) local stand_anim = def.stand_anim --variables - local velo = entity.object:getvelocity() - local pos = entity.object:getpos() + local velo = entity.object:get_velocity() + local pos = entity.object:get_pos() local node = minetest.get_node(pos).name --timer dependant variables @@ -818,14 +818,14 @@ function vehicles.object_no_drive(entity, dtime, def) --apply water effects if is_watercraft and entity.in_water then - entity.object:setvelocity({x=velo.x*0.9, y=velo.y+1, z=velo.z*0.9}) + entity.object:set_velocity({x=velo.x*0.9, y=velo.y+1, z=velo.z*0.9}) elseif is_watercraft and entity.on_water == false then - entity.object:setvelocity({x=velo.x*decell,y=velo.y-1,z=velo.z*decell}) + entity.object:set_velocity({x=velo.x*decell,y=velo.y-1,z=velo.z*decell}) elseif entity.on_water and not is_watercraft then - entity.object:setvelocity({x=velo.x*0.9, y=-1, z=velo.z*0.9}) + entity.object:set_velocity({x=velo.x*0.9, y=-1, z=velo.z*0.9}) else --stop - entity.object:setvelocity(vec_stop) + entity.object:set_velocity(vec_stop) --animation if moving_anim ~= nil and entity.moving and not hovering then entity.object:set_animation(stand_anim, 20, 0) diff --git a/mods/weather/init.lua b/mods/weather/init.lua index ec89e5f..f1e6c64 100644 --- a/mods/weather/init.lua +++ b/mods/weather/init.lua @@ -1,4 +1,4 @@ -if minetest.setting_get("enable_weather") then +if minetest.settings:get("enable_weather") then local weathers = { {"snow", "rain", "storm", "dust", "insects", "none"}, } @@ -14,7 +14,7 @@ minetest.register_node("weather:ice", { tiles = { "weather_ice.png", }, - use_texture_alpha = true, + use_texture_alpha = "blend", drawtype = "nodebox", paramtype = "light", node_box = { @@ -33,7 +33,12 @@ local apply_weather = function(player, pos, weather_type) --weather effects if weather_type == "snow" then if minetest.get_timeofday()*24000 >= 6000 and minetest.get_timeofday()*24000 <= 19000 then - player:set_sky({r=208, g=223, b=238}, "plain", nil, true) + -- player:set_sky({r=208, g=223, b=238}, "plain", nil, true) + player:set_sky({ + base_color = {r=208, g=223, b=238}, + type = "plain", + clouds = true, + }) end for i=1,24 do minetest.add_particle({ @@ -57,7 +62,12 @@ local apply_weather = function(player, pos, weather_type) end elseif weather_type == "rain" then if minetest.get_timeofday()*24000 >= 6000 and minetest.get_timeofday()*24000 <= 19000 then - player:set_sky({r=177, g=177, b=177}, "plain", nil, true) + -- player:set_sky({r=177, g=177, b=177}, "plain", nil, true) + player:set_sky({ + base_color = {r=177, g=177, b=177}, + type = "plain", + clouds = true, + }) end for i=1,24 do minetest.add_particle({ @@ -75,7 +85,12 @@ local apply_weather = function(player, pos, weather_type) end elseif weather_type == "storm" then if minetest.get_timeofday()*24000 >= 6000 and minetest.get_timeofday()*24000 <= 19000 then - player:set_sky({r=101, g=101, b=101}, "plain", nil, true) + -- player:set_sky({r=101, g=101, b=101}, "plain", nil, true) + player:set_sky({ + base_color = {r=101, g=101, b=101}, + type = "plain", + clouds = true, + }) end for i=1,48 do minetest.add_particle({ @@ -96,7 +111,12 @@ local apply_weather = function(player, pos, weather_type) end elseif weather_type == "dust" then if minetest.get_timeofday()*24000 >= 6000 and minetest.get_timeofday()*24000 <= 19000 then - player:set_sky({r=215, g=156, b=91}, "plain", nil, true) + -- player:set_sky({r=215, g=156, b=91}, "plain", nil, true) + player:set_sky({ + base_color = {r=215, g=156, b=91}, + type = "plain", + clouds = true, + }) end for i=1,12 do minetest.add_particle({ @@ -113,10 +133,18 @@ local apply_weather = function(player, pos, weather_type) }) end elseif weather_type == "insects" then - player:set_sky(nil, "regular", nil, true) + -- player:set_sky(nil, "regular", nil, true) + player:set_sky({ + type = "regular", + clouds = true, + }) elseif weather_type == "none" then - player:set_sky(nil, "regular", nil, true) - return + -- player:set_sky(nil, "regular", nil, true) + player:set_sky({ + type = "regular", + clouds = true, + }) + return end end @@ -142,7 +170,7 @@ minetest.register_globalstep(function(dtime) end --player specific for _, player in ipairs(minetest.get_connected_players()) do - local pos = player:getpos() + local pos = player:get_pos() --check if weather should occur at current location local display_weather = false for _, row in ipairs(nodes) do @@ -150,7 +178,7 @@ minetest.register_globalstep(function(dtime) display_weather = true elseif row[weather.current] == nil then display_weather = true - else + else display_weather = false end end @@ -159,7 +187,11 @@ minetest.register_globalstep(function(dtime) if display_weather then apply_weather(player, pos, weather.weather) if minetest.get_timeofday()*24000 <= 6000 or minetest.get_timeofday()*24000 >= 19000 then - player:set_sky(nil, "regular", nil, true) + -- player:set_sky(nil, "regular", nil, true) + player:set_sky({ + type = "regular", + clouds = true, + }) end else apply_weather(player, pos, "none") @@ -188,4 +220,4 @@ minetest.register_chatcommand("change_weather", { end end, }) -end \ No newline at end of file +end diff --git a/mods/wieldview/init.lua b/mods/wieldview/init.lua index 7a5a619..e207597 100644 --- a/mods/wieldview/init.lua +++ b/mods/wieldview/init.lua @@ -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 = { @@ -73,4 +73,3 @@ minetest.register_globalstep(function(dtime) time = 0 end end) - diff --git a/mods/witchcraft/brewing_stand.lua b/mods/witchcraft/brewing_stand.lua index 0a882db..f5f8ba8 100644 --- a/mods/witchcraft/brewing_stand.lua +++ b/mods/witchcraft/brewing_stand.lua @@ -13,7 +13,7 @@ minetest.register_node("witchcraft:brewing_stand", { "witchcraft_brewing_stand_side.png" }, drawtype = "nodebox", - use_texture_alpha = true, + use_texture_alpha = "blend", paramtype = "light", drop = { items = { @@ -59,9 +59,9 @@ minetest.register_node("witchcraft:brewing_stand_active", { "witchcraft_brewing_stand_side.png" }, drawtype = "nodebox", - use_texture_alpha = true, + use_texture_alpha = "blend", paramtype = "light", - light_source = 1, + light_source = 1, drop = { items = { {items = {'witchcraft:brewing_stand_unready'}, rarity = 1}, @@ -96,9 +96,9 @@ minetest.register_node("witchcraft:brewing_stand_unready", { }, inventory_image = "witchcraft_brewing_stand_inv.png", drawtype = "nodebox", - use_texture_alpha = true, + use_texture_alpha = "blend", paramtype = "light", - light_source = 1, + light_source = 1, drop = { items = { {items = {'witchcraft:brewing_stand_unready'}, rarity = 1}, @@ -161,4 +161,4 @@ minetest.register_craft({ {'group:stick', 'default:diamond', 'group:stick'}, {'', 'default:obsidian_shard', ''}, } -}) \ No newline at end of file +}) diff --git a/mods/witchcraft/init.lua b/mods/witchcraft/init.lua index 946a065..abcc995 100644 --- a/mods/witchcraft/init.lua +++ b/mods/witchcraft/init.lua @@ -73,7 +73,7 @@ minetest.register_node("witchcraft:shelf", { local stack = inv:get_stack(from_list, from_index) local to_stack = inv:get_stack(to_list, to_index) if to_list == "vessels" then - if minetest.get_item_group(stack:get_name(), "potion") ~= 0 + if minetest.get_item_group(stack:get_name(), "potion") ~= 0 and to_stack:is_empty() then return 1 else @@ -914,12 +914,12 @@ minetest.register_entity("witchcraft:tnt_splash", { velocity = 0.1, damage = 2, collisionbox = {0, 0, 0, 0, 0, 0}, - on_step = function(self, obj, pos) - local remove = minetest.after(2, function() + on_step = function(self, obj, pos) + local remove = minetest.after(2, function() self.object:remove() end) - local pos = self.object:getpos() - local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) + local pos = self.object:get_pos() + local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) for k, obj in pairs(objs) do if obj:get_luaentity() ~= nil then if obj:get_luaentity().name ~= "witchcraft:tnt_splash" and obj:get_luaentity().name ~= "__builtin:item" then @@ -938,10 +938,10 @@ minetest.register_entity("witchcraft:tnt_splash", { local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz} local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} local n = minetest.env:get_node(p).name - if n ~= "witchcraft:tnt_splash" and n ~="default:obsidian" and n ~= "air" then - local pos = self.object:getpos() + if n ~= "witchcraft:tnt_splash" and n ~="default:obsidian" and n ~= "air" then + local pos = self.object:get_pos() minetest.sound_play("default_break_glass.1", { - pos = self.object:getpos(), + pos = self.object:get_pos(), gaint = 1.0, max_hear_distance = 20, }) @@ -953,7 +953,7 @@ minetest.register_entity("witchcraft:tnt_splash", { end end hit_node = function(self, pos, node) - local pos = self.object:getpos() + local pos = self.object:get_pos() for dx=-4,4 do for dy=-4,4 do for dz=-4,4 do @@ -973,7 +973,7 @@ minetest.register_entity("witchcraft:tnt_splash", { end end end - + end, }) @@ -984,12 +984,12 @@ minetest.register_entity("witchcraft:fire_splash", { velocity = 0.1, damage = 2, collisionbox = {0, 0, 0, 0, 0, 0}, - on_step = function(self, obj, pos) - local remove = minetest.after(2, function() + on_step = function(self, obj, pos) + local remove = minetest.after(2, function() self.object:remove() end) - local pos = self.object:getpos() - local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) + local pos = self.object:get_pos() + local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) for k, obj in pairs(objs) do if obj:get_luaentity() ~= nil then if obj:get_luaentity().name ~= "witchcraft:fire_splash" and obj:get_luaentity().name ~= "__builtin:item" then @@ -1013,7 +1013,7 @@ minetest.register_entity("witchcraft:fire_splash", { end minetest.env:set_node(t, {name="fire:basic_flame"}) minetest.sound_play("default_break_glass.1", { - pos = self.object:getpos(), + pos = self.object:get_pos(), max_hear_distance = 20, gain = 10.0, }) @@ -1026,7 +1026,7 @@ minetest.register_entity("witchcraft:fire_splash", { end end hit_node = function(self, pos, node) - local pos = self.object:getpos() + local pos = self.object:get_pos() for dx=-4,4 do for dy=-4,4 do for dz=-4,4 do @@ -1043,7 +1043,7 @@ minetest.register_entity("witchcraft:fire_splash", { end end end - + end, }) @@ -1052,12 +1052,12 @@ minetest.register_entity("witchcraft:death_splash", { velocity = 0.1, damage = 2, collisionbox = {0, 0, 0, 0, 0, 0}, - on_step = function(self, obj, pos) - local remove = minetest.after(2, function() + on_step = function(self, obj, pos) + local remove = minetest.after(2, function() self.object:remove() end) - local pos = self.object:getpos() - local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) + local pos = self.object:get_pos() + local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) for k, obj in pairs(objs) do if obj:get_luaentity() ~= nil then if obj:get_luaentity().name ~= "witchcraft:death_splash" and obj:get_luaentity().name ~= "__builtin:item" then @@ -1077,7 +1077,7 @@ minetest.register_entity("witchcraft:death_splash", { local n = minetest.env:get_node(p).name if n ~= "witchcraft:death_splash" and n ~= "air" then minetest.sound_play("default_break_glass.1", { - pos = self.object:getpos(), + pos = self.object:get_pos(), max_hear_distance = 20, gain = 10.0, }) @@ -1089,8 +1089,8 @@ minetest.register_entity("witchcraft:death_splash", { end end end - - + + end, }) @@ -1099,12 +1099,12 @@ minetest.register_entity("witchcraft:heal_splash", { velocity = 0.1, damage = 2, collisionbox = {0, 0, 0, 0, 0, 0}, - on_step = function(self, obj, pos) - local remove = minetest.after(2, function() + on_step = function(self, obj, pos) + local remove = minetest.after(2, function() self.object:remove() end) - local pos = self.object:getpos() - local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) + local pos = self.object:get_pos() + local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) for k, obj in pairs(objs) do if obj:get_luaentity() ~= nil then if obj:get_luaentity().name ~= "witchcraft:heal_splash" and obj:get_luaentity().name ~= "__builtin:item" then @@ -1124,7 +1124,7 @@ minetest.register_entity("witchcraft:heal_splash", { local n = minetest.env:get_node(p).name if n ~= "witchcraft:heal_splash" and n ~= "air" then minetest.sound_play("default_break_glass.1", { - pos = self.object:getpos(), + pos = self.object:get_pos(), max_hear_distance = 20, gain = 10.0, }) @@ -1136,8 +1136,8 @@ minetest.register_entity("witchcraft:heal_splash", { end end end - - + + end, }) @@ -1146,17 +1146,17 @@ minetest.register_entity("witchcraft:slow_splash", { velocity = 0.1, damage = 2, collisionbox = {0, 0, 0, 0, 0, 0}, - on_step = function(self, obj, pos) - local remove = minetest.after(2, function() + on_step = function(self, obj, pos) + local remove = minetest.after(2, function() self.object:remove() end) - local pos = self.object:getpos() - local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) + local pos = self.object:get_pos() + local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) for k, obj in pairs(objs) do if obj:get_luaentity() ~= nil then if obj:get_luaentity().name ~= "witchcraft:slow_splash" and obj:get_luaentity().name ~= "__builtin:item" then - local vel = obj:getvelocity() - obj:setvelocity({x=vel.x*0.5, y=vel.y*0.5, z=vel.z*0.5}) + local vel = obj:get_velocity() + obj:set_velocity({x=vel.x*0.5, y=vel.y*0.5, z=vel.z*0.5}) self.object:remove() end end @@ -1168,11 +1168,11 @@ minetest.register_entity("witchcraft:slow_splash", { local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} local n = minetest.env:get_node(p).name if n ~= "witchcraft:slow_splash" and n ~= "air" then - + self.object:remove() elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then minetest.sound_play("default_break_glass.1", { - pos = self.object:getpos(), + pos = self.object:get_pos(), max_hear_distance = 20, gain = 10.0, }) @@ -1182,8 +1182,8 @@ minetest.register_entity("witchcraft:slow_splash", { end end end - - + + end, }) @@ -1192,17 +1192,17 @@ minetest.register_entity("witchcraft:fast_splash", { velocity = 0.1, damage = 2, collisionbox = {0, 0, 0, 0, 0, 0}, - on_step = function(self, obj, pos) - local remove = minetest.after(2, function() + on_step = function(self, obj, pos) + local remove = minetest.after(2, function() self.object:remove() end) - local pos = self.object:getpos() - local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) + local pos = self.object:get_pos() + local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) for k, obj in pairs(objs) do if obj:get_luaentity() ~= nil then if obj:get_luaentity().name ~= "witchcraft:fast_splash" and obj:get_luaentity().name ~= "__builtin:item" then - local vel = obj:getvelocity() - obj:setvelocity({x=vel.x*4, y=vel.y*1, z=vel.z*4}) + local vel = obj:get_velocity() + obj:set_velocity({x=vel.x*4, y=vel.y*1, z=vel.z*4}) self.object:remove() end end @@ -1214,11 +1214,11 @@ minetest.register_entity("witchcraft:fast_splash", { local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} local n = minetest.env:get_node(p).name if n ~= "witchcraft:fast_splash" and n ~= "air" then - + self.object:remove() elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then minetest.sound_play("default_break_glass.1", { - pos = self.object:getpos(), + pos = self.object:get_pos(), max_hear_distance = 20, gain = 10.0, }) @@ -1228,8 +1228,8 @@ minetest.register_entity("witchcraft:fast_splash", { end end end - - + + end, }) @@ -1238,17 +1238,17 @@ minetest.register_entity("witchcraft:antigrav_splash", { velocity = 0.1, damage = 2, collisionbox = {0, 0, 0, 0, 0, 0}, - on_step = function(self, obj, pos) - local remove = minetest.after(2, function() + on_step = function(self, obj, pos) + local remove = minetest.after(2, function() self.object:remove() end) - local pos = self.object:getpos() - local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) + local pos = self.object:get_pos() + local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) for k, obj in pairs(objs) do if obj:get_luaentity() ~= nil then if obj:get_luaentity().name ~= "witchcraft:antigrav_splash" and obj:get_luaentity().name ~= "__builtin:item" then - local vel = obj:getvelocity() - obj:setvelocity({x=vel.x*1, y=vel.y*0.1, z=vel.z*1}) + local vel = obj:get_velocity() + obj:set_velocity({x=vel.x*1, y=vel.y*0.1, z=vel.z*1}) self.object:remove() end end @@ -1260,11 +1260,11 @@ minetest.register_entity("witchcraft:antigrav_splash", { local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} local n = minetest.env:get_node(p).name if n ~= "witchcraft:antigrav_splash" and n ~= "air" then - + self.object:remove() elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then minetest.sound_play("default_break_glass.1", { - pos = self.object:getpos(), + pos = self.object:get_pos(), max_hear_distance = 20, gain = 10.0, }) @@ -1274,8 +1274,8 @@ minetest.register_entity("witchcraft:antigrav_splash", { end end end - - + + end, }) @@ -1284,17 +1284,17 @@ minetest.register_entity("witchcraft:jump_splash", { velocity = 0.1, damage = 2, collisionbox = {0, 0, 0, 0, 0, 0}, - on_step = function(self, obj, pos) - local remove = minetest.after(2, function() + on_step = function(self, obj, pos) + local remove = minetest.after(2, function() self.object:remove() end) - local pos = self.object:getpos() - local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) + local pos = self.object:get_pos() + local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) for k, obj in pairs(objs) do if obj:get_luaentity() ~= nil then if obj:get_luaentity().name ~= "witchcraft:jump_splash" and obj:get_luaentity().name ~= "__builtin:item" then - local vel = obj:getvelocity() - obj:setvelocity({x=vel.x*1, y=(vel.y+2)*3, z=vel.z*1}) + local vel = obj:get_velocity() + obj:set_velocity({x=vel.x*1, y=(vel.y+2)*3, z=vel.z*1}) self.object:remove() end end @@ -1306,11 +1306,11 @@ minetest.register_entity("witchcraft:jump_splash", { local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} local n = minetest.env:get_node(p).name if n ~= "witchcraft:jump_splash" and n ~= "air" then - + self.object:remove() elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then minetest.sound_play("default_break_glass.1", { - pos = self.object:getpos(), + pos = self.object:get_pos(), max_hear_distance = 20, gain = 10.0, }) @@ -1320,8 +1320,8 @@ minetest.register_entity("witchcraft:jump_splash", { end end end - - + + end, }) @@ -1330,12 +1330,12 @@ minetest.register_entity("witchcraft:murky_splash", { velocity = 0.1, damage = 2, collisionbox = {0, 0, 0, 0, 0, 0}, - on_step = function(self, obj, pos) - local remove = minetest.after(2, function() + on_step = function(self, obj, pos) + local remove = minetest.after(2, function() self.object:remove() end) - local pos = self.object:getpos() - local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) + local pos = self.object:get_pos() + local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) for k, obj in pairs(objs) do if obj:get_luaentity() ~= nil then if obj:get_luaentity().name ~= "witchcraft:murky_splash" and obj:get_luaentity().name ~= "__builtin:item" then @@ -1355,7 +1355,7 @@ minetest.register_entity("witchcraft:murky_splash", { local n = minetest.env:get_node(p).name if n ~= "witchcraft:murky_splash" and n ~= "air" then minetest.sound_play("default_break_glass.1", { - pos = self.object:getpos(), + pos = self.object:get_pos(), max_hear_distance = 20, gain = 10.0, }) @@ -1367,8 +1367,8 @@ minetest.register_entity("witchcraft:murky_splash", { end end end - - + + end, }) @@ -1378,11 +1378,11 @@ minetest.register_entity("witchcraft:shadow_splash", { damage = 2, physical = true, collisionbox = {-0.1, -0.1, -0.1, 0.1, 0.1, 0.1}, - on_step = function(self, obj, pos) - local remove = minetest.after(5, function() + on_step = function(self, obj, pos) + local remove = minetest.after(5, function() self.object:remove() end) - local pos = self.object:getpos() + local pos = self.object:get_pos() minetest.add_particlespawner( 50, --amount 1, --time @@ -1408,13 +1408,13 @@ minetest.register_entity("witchcraft:smoke_splash", { damage = 2, physical = true, collisionbox = {-0.1, -0.1, -0.1, 0.1, 0.1, 0.1}, - on_step = function(self, obj, pos) - local remove = minetest.after(10, function() + on_step = function(self, obj, pos) + local remove = minetest.after(10, function() self.object:remove() end) - local pos = self.object:getpos() - local velo = self.object:getvelocity() - self.object:setvelocity({x=velo.x*0.9,y=velo.y,z=velo.z*0.9}) + local pos = self.object:get_pos() + local velo = self.object:get_velocity() + self.object:set_velocity({x=velo.x*0.9,y=velo.y,z=velo.z*0.9}) minetest.add_particlespawner( 10, --amount 1, --time @@ -1431,103 +1431,103 @@ minetest.register_entity("witchcraft:smoke_splash", { false, --collisiondetection "witchcraft_smoke.png" --texture ) - + end, }) --player effects -playereffects.register_effect_type("potion_speed_lv1", "High speed", nil, {"speed"}, +playereffects.register_effect_type("potion_speed_lv1", "High speed", nil, {"speed"}, function(player) player:set_physics_override(2,nil,nil) end, - + function(effect, player) player:set_physics_override(1,nil,nil) end, false ) -playereffects.register_effect_type("potion_speed_lv2", "High speed", nil, {"speed"}, +playereffects.register_effect_type("potion_speed_lv2", "High speed", nil, {"speed"}, function(player) player:set_physics_override(2.5,nil,nil) end, - + function(effect, player) player:set_physics_override(1,nil,nil) end, false ) -playereffects.register_effect_type("potion_jump_lvx", "High Jump", nil, {"jump"}, +playereffects.register_effect_type("potion_jump_lvx", "High Jump", nil, {"jump"}, function(player) player:set_physics_override(nil,1.5,0.8) end, - + function(effect, player) player:set_physics_override(nil,1,1) end, false ) -playereffects.register_effect_type("potion_antigrav_lvx", "Light weight", nil, {"gravity"}, +playereffects.register_effect_type("potion_antigrav_lvx", "Light weight", nil, {"gravity"}, function(player) player:set_physics_override(nil,nil,0.1) end, - + function(effect, player) player:set_physics_override(nil,nil,1) end, false ) -playereffects.register_effect_type("potion_slow_lv1", "Low speed", nil, {"speed"}, +playereffects.register_effect_type("potion_slow_lv1", "Low speed", nil, {"speed"}, function(player) player:set_physics_override(0.5,nil,nil) end, - + function(effect, player) player:set_physics_override(1,nil,nil) end, false ) -playereffects.register_effect_type("potion_slow_lv2", "Low speed", nil, {"speed"}, +playereffects.register_effect_type("potion_slow_lv2", "Low speed", nil, {"speed"}, function(player) player:set_physics_override(0.4,nil,nil) end, - + function(effect, player) player:set_physics_override(1,nil,nil) end, false ) -playereffects.register_effect_type("potion_swim_lv1", "Fast Swim", nil, {"swim"}, +playereffects.register_effect_type("potion_swim_lv1", "Fast Swim", nil, {"swim"}, function(player) player:set_physics_override(3,nil,nil) end, - + function(effect, player) player:set_physics_override(1,nil,nil) end, false ) -playereffects.register_effect_type("potion_swim_lv2", "Dive", nil, {"swim"}, +playereffects.register_effect_type("potion_swim_lv2", "Dive", nil, {"swim"}, function(player) player:set_physics_override(3,nil,4) end, - + function(effect, player) player:set_physics_override(1,nil,1) end, false ) -playereffects.register_effect_type("potion_silver", "Fire resist", nil, {"fire_resist"}, +playereffects.register_effect_type("potion_silver", "Fire resist", nil, {"fire_resist"}, function(player) - local pos = player:getpos() + local pos = player:get_pos() local node = minetest.get_node(pos).name if node == "default:lava_source" or node == "default:lava_flowing" or node == "fire:basic_flame" then local hp1 = player:get_hp() @@ -1567,12 +1567,12 @@ minetest.register_node("witchcraft:splash_orange", { inventory_image = "witchcraft_splash_orange.png", on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*6,y=dir.y*3.5,z=dir.z*6} local acc = {x=0,y=-9.8,z=0} local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fire_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) + obj:set_velocity(vec) + obj:set_acceleration(acc) item:take_item() return item end, @@ -1596,12 +1596,12 @@ minetest.register_node("witchcraft:splash_purple", { inventory_image = "witchcraft_splash_purple.png", on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9} local acc = {x=0,y=-9.8,z=0} local obj = minetest.env:add_entity({x=playerpos.x+dir.x,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z}, "witchcraft:smoke_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) + obj:set_velocity(vec) + obj:set_acceleration(acc) item:take_item() return item end, @@ -1625,12 +1625,12 @@ minetest.register_node("witchcraft:splash_red", { inventory_image = "witchcraft_splash_red.png", on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9} local acc = {x=0,y=-9,z=0} local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:heal_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) + obj:set_velocity(vec) + obj:set_acceleration(acc) item:take_item() return item end, @@ -1654,12 +1654,12 @@ minetest.register_node("witchcraft:splash_green", { inventory_image = "witchcraft_splash_green.png", on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9} local acc = {x=0,y=-9,z=0} local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:jump_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) + obj:set_velocity(vec) + obj:set_acceleration(acc) item:take_item() return item end, @@ -1683,12 +1683,12 @@ minetest.register_node("witchcraft:splash_cyan", { inventory_image = "witchcraft_splash_cyan.png", on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9} local acc = {x=0,y=-9,z=0} local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:antigrav_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) + obj:set_velocity(vec) + obj:set_acceleration(acc) item:take_item() return item end, @@ -1712,12 +1712,12 @@ minetest.register_node("witchcraft:splash_redbrown", { inventory_image = "witchcraft_splash_redbrown.png", on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9} local acc = {x=0,y=-9,z=0} local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:slow_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) + obj:set_velocity(vec) + obj:set_acceleration(acc) item:take_item() return item end, @@ -1741,12 +1741,12 @@ minetest.register_node("witchcraft:splash_magenta", { inventory_image = "witchcraft_splash_magenta.png", on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*13,y=dir.y*2.5,z=dir.z*13} local acc = {x=0,y=-9,z=0} local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:fast_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) + obj:set_velocity(vec) + obj:set_acceleration(acc) item:take_item() return item end, @@ -1770,12 +1770,12 @@ minetest.register_node("witchcraft:splash_brown", { inventory_image = "witchcraft_splash_brown.png", on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9} local acc = {x=0,y=-9,z=0} local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:murky_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) + obj:set_velocity(vec) + obj:set_acceleration(acc) item:take_item() return item end, @@ -1799,12 +1799,12 @@ minetest.register_node("witchcraft:splash_grey", { inventory_image = "witchcraft_splash_grey.png", on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9} local acc = {x=0,y=-9,z=0} local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:death_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) + obj:set_velocity(vec) + obj:set_acceleration(acc) item:take_item() return item end, @@ -1830,12 +1830,12 @@ minetest.register_node("witchcraft:splash_ggreen", { inventory_image = "witchcraft_splash_ggreen.png", on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*6,y=dir.y*3.5,z=dir.z*6} local acc = {x=0,y=-9.8,z=0} local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:shadow_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) + obj:set_velocity(vec) + obj:set_acceleration(acc) item:take_item() return item end, @@ -1859,12 +1859,12 @@ minetest.register_node("witchcraft:splash_yellwgrn", { inventory_image = "witchcraft_splash_yellgrn.png", on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*7,y=dir.y*3.5,z=dir.z*7} local acc = {x=0,y=-9.8,z=0} local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:tnt_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) + obj:set_velocity(vec) + obj:set_acceleration(acc) item:take_item() return item end, @@ -1939,7 +1939,7 @@ minetest.register_node("witchcraft:potion_darkpurple", { on_use = function(itemstack, user) --invisibility effect from invisibility potion by Tenplus1 - local pos = user:getpos() + local pos = user:get_pos() -- make player invisible invisible(user, true) @@ -1954,7 +1954,7 @@ minetest.register_node("witchcraft:potion_darkpurple", { -- display 10 second warning minetest.after(290, function() - if user:getpos() then + if user:get_pos() then minetest.chat_send_player(user:get_player_name(), ">>> You have 10 seconds before invisibility wears off!") @@ -1964,7 +1964,7 @@ minetest.register_node("witchcraft:potion_darkpurple", { -- make player visible 5 minutes later minetest.after(300, function() - if user:getpos() then + if user:get_pos() then -- show aready hidden player invisible(user, nil) @@ -1979,7 +1979,7 @@ minetest.register_node("witchcraft:potion_darkpurple", { end) --effect - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -1996,9 +1996,9 @@ minetest.register_node("witchcraft:potion_darkpurple", { false, --collisiondetection "witchcraft_effect.png" --texture ) - + -- take item - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then itemstack:take_item() @@ -2026,7 +2026,7 @@ minetest.register_node("witchcraft:potion_darkpurple_2", { inventory_image = "witchcraft_potion_darkpurple.png^[colorize:black:50", on_use = function(itemstack, user) - local pos = user:getpos() + local pos = user:get_pos() -- make player invisible invisible(user, true) @@ -2041,7 +2041,7 @@ minetest.register_node("witchcraft:potion_darkpurple_2", { -- display 10 second warning minetest.after(340, function() - if user:getpos() then + if user:get_pos() then minetest.chat_send_player(user:get_player_name(), ">>> You have 10 seconds before invisibility wears off!") @@ -2051,7 +2051,7 @@ minetest.register_node("witchcraft:potion_darkpurple_2", { -- make player visible 5 minutes later minetest.after(350, function() - if user:getpos() then + if user:get_pos() then -- show aready hidden player invisible(user, nil) @@ -2066,7 +2066,7 @@ minetest.register_node("witchcraft:potion_darkpurple_2", { end) --effect - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -2083,9 +2083,9 @@ minetest.register_node("witchcraft:potion_darkpurple_2", { false, --collisiondetection "witchcraft_effect.png" --texture ) - + -- take item - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then itemstack:take_item() @@ -2151,7 +2151,7 @@ minetest.register_node("witchcraft:potion_yllwgrn", { sounds = default.node_sound_glass_defaults(), inventory_image = "witchcraft_potion_yellgrn.png", on_use = function(pos, placer, itemstack) - local pos = placer:getpos(); + local pos = placer:get_pos(); tnt.boom(pos, {damage_radius=5,radius=3,ignore_protection=false}) return itemstack end, @@ -2174,7 +2174,7 @@ minetest.register_node("witchcraft:potion_yllwgrn_2", { sounds = default.node_sound_glass_defaults(), inventory_image = "witchcraft_potion_yellgrn.png^[colorize:black:50", on_use = function(pos, placer, itemstack) - local pos = placer:getpos(); + local pos = placer:get_pos(); tnt.boom(pos, {damage_radius=10,radius=4,ignore_protection=false}) return itemstack end, @@ -2187,12 +2187,12 @@ minetest.register_entity("witchcraft:fire", { velocity = 0.1, damage = 2, collisionbox = {0, 0, 0, 0, 0, 0}, - on_step = function(self, obj, pos) - local remove = minetest.after(2, function() + on_step = function(self, obj, pos) + local remove = minetest.after(2, function() self.object:remove() end) - local pos = self.object:getpos() - local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) + local pos = self.object:get_pos() + local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) for k, obj in pairs(objs) do if obj:get_luaentity() ~= nil then if obj:get_luaentity().name ~= "witchcraft:fire" and obj:get_luaentity().name ~= "__builtin:item" then @@ -2210,7 +2210,7 @@ minetest.register_entity("witchcraft:fire", { local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz} local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} local n = minetest.env:get_node(p).name - if n ~= "witchcraft:fire" and n ~= "air" and n ~="default:dirt_with_grass" and n ~="default:dirt_with_dry_grass" and n ~="default:stone" then + if n ~= "witchcraft:fire" and n ~= "air" and n ~="default:dirt_with_grass" and n ~="default:dirt_with_dry_grass" and n ~="default:stone" then minetest.env:set_node(t, {name="fire:basic_flame"}) elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then self.object:remove() @@ -2220,7 +2220,7 @@ minetest.register_entity("witchcraft:fire", { end end hit_node = function(self, pos, node) - local pos = self.object:getpos() + local pos = self.object:get_pos() for dx=-4,4 do for dy=-4,4 do for dz=-4,4 do @@ -2238,7 +2238,7 @@ minetest.register_entity("witchcraft:fire", { end end - local apos = self.object:getpos() + local apos = self.object:get_pos() local part = minetest.add_particlespawner( 10, --amount 0.3, --time @@ -2255,7 +2255,7 @@ minetest.register_entity("witchcraft:fire", { false, --collisiondetection "witchcraft_flame.png" --texture ) - + end, }) @@ -2278,10 +2278,10 @@ minetest.register_node("witchcraft:potion_orange", { inventory_image = "witchcraft_potion_orange.png", on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*2,y=dir.y*2.5,z=dir.z*2} local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fire") - obj:setvelocity(vec) + obj:set_velocity(vec) local part = minetest.add_particlespawner( 10, --amount 0.3, --time @@ -2298,7 +2298,7 @@ minetest.register_node("witchcraft:potion_orange", { false, --collisiondetection "witchcraft_flame.png" --texture ) - + item:replace("vessels:glass_bottle") return item end, @@ -2322,10 +2322,10 @@ minetest.register_node("witchcraft:potion_orange_2", { inventory_image = "witchcraft_potion_orange.png^[colorize:black:50", on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*3,y=dir.y*3.5,z=dir.z*3} local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fire") - obj:setvelocity(vec) + obj:set_velocity(vec) local part = minetest.add_particlespawner( 10, --amount 0.3, --time @@ -2342,7 +2342,7 @@ minetest.register_node("witchcraft:potion_orange_2", { false, --collisiondetection "witchcraft_flame.png^[colorize:blue:200" --texture ) - + item:replace("vessels:glass_bottle") return item end, @@ -2366,12 +2366,12 @@ minetest.register_node("witchcraft:splash_orange", { inventory_image = "witchcraft_splash_orange.png", on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*6,y=dir.y*3.5,z=dir.z*6} local acc = {x=0,y=-9.8,z=0} local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fire_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) + obj:set_velocity(vec) + obj:set_acceleration(acc) item:take_item() return item end, @@ -2395,12 +2395,12 @@ minetest.register_node("witchcraft:splash_yellwgrn", { inventory_image = "witchcraft_splash_yellgrn.png", on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*7,y=dir.y*3.5,z=dir.z*7} local acc = {x=0,y=-9.8,z=0} local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:tnt_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) + obj:set_velocity(vec) + obj:set_acceleration(acc) item:take_item() return item end, @@ -2424,7 +2424,7 @@ minetest.register_node("witchcraft:potion_purple", { inventory_image = "witchcraft_potion_purple.png", on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*2,y=dir.y*2.5,z=dir.z*2} local part = minetest.add_particlespawner( 20, --amount @@ -2442,7 +2442,7 @@ minetest.register_node("witchcraft:potion_purple", { false, --collisiondetection "witchcraft_smoke.png^[colorize:magenta:50" --texture ) - + item:replace("vessels:glass_bottle") return item end, @@ -2522,7 +2522,7 @@ else itemstack:replace("vessels:glass_bottle") return itemstack end, - + minetest.register_node("witchcraft:potion_gred", { description = "Hunger Potion", drawtype = "plantlike", @@ -2567,7 +2567,7 @@ minetest.register_node("witchcraft:potion_purple_2", { inventory_image = "witchcraft_potion_purple.png^[colorize:black:20", on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*2,y=dir.y*2.5,z=dir.z*2} local part = minetest.add_particlespawner( 20, --amount @@ -2585,7 +2585,7 @@ minetest.register_node("witchcraft:potion_purple_2", { false, --collisiondetection "witchcraft_smoke.png^[colorize:magenta:50" --texture ) - + item:replace("vessels:glass_bottle") return item end, @@ -2734,7 +2734,7 @@ minetest.register_node("witchcraft:potion_green", { minetest.chat_send_player(player, "This area is protected.") end end - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -2782,7 +2782,7 @@ minetest.register_node("witchcraft:potion_green", { minetest.chat_send_player(player, "This area is protected.") end end - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -2831,7 +2831,7 @@ minetest.register_node("witchcraft:potion_gold", { minetest.chat_send_player(player, "This area is protected.") end end - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -2879,7 +2879,7 @@ minetest.register_node("witchcraft:potion_gold_2", { minetest.chat_send_player(player, "This area is protected.") end end - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -2921,7 +2921,7 @@ minetest.register_node("witchcraft:potion_aqua", { sounds = default.node_sound_glass_defaults(), inventory_image = "witchcraft_potion_aqua.png", on_use = function(item, placer, pos) - local pos = placer:getpos(); + local pos = placer:get_pos(); minetest.add_particlespawner( 6, --amount 0.1, --time @@ -2943,7 +2943,7 @@ minetest.register_node("witchcraft:potion_aqua", { minetest.env:add_entity(pos, "experience:orb") minetest.env:add_entity(pos, "experience:orb") minetest.env:add_entity(pos, "experience:orb") - + item:replace("vessels:glass_bottle") return item end @@ -2966,7 +2966,7 @@ minetest.register_node("witchcraft:potion_aqua", { sounds = default.node_sound_glass_defaults(), inventory_image = "witchcraft_potion_aqua.png", on_use = function(item, placer, pos) - local pos = placer:getpos(); + local pos = placer:get_pos(); minetest.add_particlespawner( 6, --amount 0.1, --time @@ -2989,7 +2989,7 @@ minetest.register_node("witchcraft:potion_aqua", { minetest.add_item(pos, "default:gold_lump") minetest.add_item(pos, "farming:bread") minetest.add_item(pos, "default:copper_ingot") - + item:replace("vessels:glass_bottle") return item end @@ -3017,7 +3017,7 @@ minetest.register_node("witchcraft:potion_magenta", { local breath_change = user:set_breath(5) playereffects.apply_effect_type("potion_speed_lv1", 10, user) - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -3060,7 +3060,7 @@ minetest.register_node("witchcraft:potion_magenta_2", { local breath_change = user:set_breath(5) playereffects.apply_effect_type("potion_speed_lv2", 10, user) - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -3102,7 +3102,7 @@ minetest.register_node("witchcraft:potion_cyan", { local player = user:get_player_name() local breath_change = user:set_breath(5) playereffects.apply_effect_type("potion_antigrav_lvx", 10, user) - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -3143,7 +3143,7 @@ minetest.register_node("witchcraft:potion_gcyan", { on_use = function(item, user, pointed_thing) local player = user:get_player_name() local breath_change = user:set_breath(12) - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -3185,7 +3185,7 @@ minetest.register_node("witchcraft:potion_cyan_2", { local player = user:get_player_name() local breath_change = user:set_breath(5) playereffects.apply_effect_type("potion_antigrav_lvx", 20, user) - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -3227,7 +3227,7 @@ minetest.register_node("witchcraft:potion_green2", { local player = user:get_player_name() local breath_change = user:set_breath(5) playereffects.apply_effect_type("potion_jump_lvx", 6, user) - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -3267,7 +3267,7 @@ minetest.register_node("witchcraft:potion_ggreen", { inventory_image = "witchcraft_potion_ggreen.png", on_use = function(item, user, pointed_thing) local player = user:get_player_name() - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 2000, --amount 1, --time @@ -3316,7 +3316,7 @@ minetest.register_node("witchcraft:potion_green2_2", { local player = user:get_player_name() local breath_change = user:set_breath(5) playereffects.apply_effect_type("potion_jump_lvx", 10, user) - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -3358,7 +3358,7 @@ minetest.register_node("witchcraft:potion_redbrown", { local player = user:get_player_name() local breath_change = user:set_breath(5) playereffects.apply_effect_type("potion_slow_lv1", 11, user) - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -3400,7 +3400,7 @@ minetest.register_node("witchcraft:potion_redbrown_2", { local player = user:get_player_name() local breath_change = user:set_breath(5) playereffects.apply_effect_type("potion_slow_lv2", 15, user) - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -3443,7 +3443,7 @@ minetest.register_node("witchcraft:potion_blue2", { local breath = user:get_breath() if breath <= 10 then playereffects.apply_effect_type("potion_swim_lv1", 15, user) - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -3487,7 +3487,7 @@ minetest.register_node("witchcraft:potion_blue2_2", { local breath = user:get_breath() if breath <= 10 then playereffects.apply_effect_type("potion_swim_lv2", 15, user) - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -3541,7 +3541,7 @@ minetest.register_node("witchcraft:potion_yellow", { on_use = function(item, user, pointed_thing) local player = user:get_player_name() lightchange(user, 10) - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -3581,7 +3581,7 @@ minetest.register_node("witchcraft:potion_yellow_2", { inventory_image = "witchcraft_potion_yellow.png^[colorize:black:50", on_use = function(item, user, pointed_thing) lightchange(user, 20) - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -3702,11 +3702,11 @@ minetest.register_node("witchcraft:pentagram", { visual_scale = 3.0, tiles = {"witchcraft_pentagram.png"}, inventory_image = "witchcraft_pentagram.png", - use_texture_alpha = true, + use_texture_alpha = "clip", paramtype = "light", paramtype2 = "wallmounted", - sunlight_propagates = false, - light_source = 50, + sunlight_propagates = false, + light_source = minetest.LIGHT_MAX, walkable = false, is_ground_content = true, selection_box = { @@ -3745,11 +3745,11 @@ minetest.register_node("witchcraft:portal", { visual_scale = 3.0, tiles = {"witchcraft_portal.png"}, inventory_image = "witchcraft_portal.png", - use_texture_alpha = true, + use_texture_alpha = "blend", paramtype = "light", paramtype2 = "wallmounted", - sunlight_propagates = false, - light_source = 50, + sunlight_propagates = false, + light_source = minetest.LIGHT_MAX, walkable = false, is_ground_content = true, selection_box = { @@ -3783,6 +3783,7 @@ minetest.register_node("witchcraft:candle", { tiles = { "witchcraft_red_candle.png", }, + use_texture_alpha = "opaque", visual_scale = 0.5, wield_image = "witchcraft_red_candle_item.png", wield_scale = {x=1.0, y=1.0, z=1.0}, diff --git a/mods/witchcraft/init_old.lua b/mods/witchcraft/init_old.lua index 5fa9d3b..4a532db 100644 --- a/mods/witchcraft/init_old.lua +++ b/mods/witchcraft/init_old.lua @@ -1090,7 +1090,7 @@ minetest.register_tool("witchcraft:potion_darkpurple", { minetest.after(30, function() default.player_set_skin(user, "character.png") end) - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -1149,7 +1149,7 @@ minetest.register_node("witchcraft:potion_yellgrn", { sounds = default.node_sound_glass_defaults(), inventory_image = "witchcraft_potion_yellgrn.png", on_use = function(pos, placer) - local pos = placer:getpos(); + local pos = placer:get_pos(); tnt.boom(pos, {damage_radius=5,radius=3,ignore_protection=false}) end, }) @@ -1165,7 +1165,7 @@ minetest.register_entity("witchcraft:fire", { local remove = minetest.after(2, function() self.object:remove() end) - local pos = self.object:getpos() + local pos = self.object:get_pos() local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) for k, obj in pairs(objs) do if obj:get_luaentity() ~= nil then @@ -1194,7 +1194,7 @@ minetest.register_entity("witchcraft:fire", { end end hit_node = function(self, pos, node) - local pos = self.object:getpos() + local pos = self.object:get_pos() for dx=-4,4 do for dy=-4,4 do for dz=-4,4 do @@ -1212,7 +1212,7 @@ minetest.register_entity("witchcraft:fire", { end end - local apos = self.object:getpos() + local apos = self.object:get_pos() local part = minetest.add_particlespawner( 10, --amount 0.3, --time @@ -1242,7 +1242,7 @@ minetest.register_entity("witchcraft:tnt_splash", { local remove = minetest.after(2, function() self.object:remove() end) - local pos = self.object:getpos() + local pos = self.object:get_pos() local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) for k, obj in pairs(objs) do if obj:get_luaentity() ~= nil then @@ -1262,9 +1262,9 @@ minetest.register_entity("witchcraft:tnt_splash", { local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} local n = minetest.env:get_node(p).name if n ~= "witchcraft:tnt_splash" and n ~="default:obsidian" and n ~= "air" then - local pos = self.object:getpos() + local pos = self.object:get_pos() minetest.sound_play("default_break_glass.1.ogg", { - pos = self.object:getpos(), + pos = self.object:get_pos(), gaint = 1.0, max_hear_distance = 20, }) @@ -1276,7 +1276,7 @@ minetest.register_entity("witchcraft:tnt_splash", { end end hit_node = function(self, pos, node) - local pos = self.object:getpos() + local pos = self.object:get_pos() for dx=-4,4 do for dy=-4,4 do for dz=-4,4 do @@ -1307,7 +1307,7 @@ minetest.register_entity("witchcraft:fire_splash", { local remove = minetest.after(2, function() self.object:remove() end) - local pos = self.object:getpos() + local pos = self.object:get_pos() local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) for k, obj in pairs(objs) do if obj:get_luaentity() ~= nil then @@ -1329,7 +1329,7 @@ minetest.register_entity("witchcraft:fire_splash", { if n ~= "witchcraft:fire_splash" and n ~= "air" then minetest.env:set_node(t, {name="fire:basic_flame"}) minetest.sound_play("default_break_glass.1", { - pos = self.object:getpos(), + pos = self.object:get_pos(), max_hear_distance = 20, gain = 10.0, }) @@ -1342,7 +1342,7 @@ minetest.register_entity("witchcraft:fire_splash", { end end hit_node = function(self, pos, node) - local pos = self.object:getpos() + local pos = self.object:get_pos() for dx=-4,4 do for dy=-4,4 do for dz=-4,4 do @@ -1381,10 +1381,10 @@ minetest.register_node("witchcraft:potion_orange", { inventory_image = "witchcraft_potion_orange.png", on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*2,y=dir.y*2.5,z=dir.z*2} local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fire") - obj:setvelocity(vec) + obj:set_velocity(vec) local part = minetest.add_particlespawner( 10, --amount 0.3, --time @@ -1425,12 +1425,12 @@ minetest.register_node("witchcraft:splash_orange", { inventory_image = "witchcraft_splash_orange.png", on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*6,y=dir.y*3.5,z=dir.z*6} local acc = {x=0,y=-9.8,z=0} local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fire_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) + obj:set_velocity(vec) + obj:set_acceleration(acc) item:take_item() return item end, @@ -1454,12 +1454,12 @@ minetest.register_node("witchcraft:splash_yellwgrn", { inventory_image = "witchcraft_splash_yellgrn.png", on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*7,y=dir.y*3.5,z=dir.z*7} local acc = {x=0,y=-9.8,z=0} local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:tnt_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) + obj:set_velocity(vec) + obj:set_acceleration(acc) item:take_item() return item end, @@ -1483,7 +1483,7 @@ minetest.register_node("witchcraft:potion_purple", { inventory_image = "witchcraft_potion_purple.png", on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*2,y=dir.y*2.5,z=dir.z*2} local part = minetest.add_particlespawner( 20, --amount @@ -1584,7 +1584,7 @@ minetest.register_node("witchcraft:potion_green", { minetest.chat_send_player(player, "This area is protected.") end end - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -1633,7 +1633,7 @@ minetest.register_node("witchcraft:potion_yellow", { minetest.chat_send_player(player, "This area is protected.") end end - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -1675,7 +1675,7 @@ minetest.register_node("witchcraft:potion_aqua", { sounds = default.node_sound_glass_defaults(), inventory_image = "witchcraft_potion_aqua.png", on_use = function(item, placer, pos) - local pos = placer:getpos(); + local pos = placer:get_pos(); minetest.add_particlespawner( 6, --amount 0.1, --time @@ -1745,7 +1745,7 @@ minetest.register_node("witchcraft:potion_magenta", { }) end) - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -1807,7 +1807,7 @@ minetest.register_node("witchcraft:potion_cyan", { }) end) - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -1869,7 +1869,7 @@ minetest.register_node("witchcraft:potion_green2", { }) end) - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -1931,7 +1931,7 @@ minetest.register_node("witchcraft:potion_redbrown", { }) end) - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -1994,7 +1994,7 @@ minetest.register_node("witchcraft:potion_blue2", { }) end) - local playerpos = user:getpos(); + local playerpos = user:get_pos(); minetest.add_particlespawner( 5, --amount 0.1, --time @@ -2046,7 +2046,7 @@ minetest.register_craftitem("witchcraft:scroll_wild", { inventory_image = "witchcraft_scroll.png^witchcraft_dark_over.png", stack_max = 1, on_use = function(item, placer) - local pos = placer:getpos(); + local pos = placer:get_pos(); minetest.env:add_entity(pos, "pmobs:dog") item:take_item() return item @@ -2060,10 +2060,10 @@ minetest.register_craftitem("witchcraft:scroll_fireball", { stack_max = 1, on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*7,y=dir.y*7,z=dir.z*7} local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fireball") - obj:setvelocity(vec) + obj:set_velocity(vec) item:take_item() return item @@ -2076,7 +2076,7 @@ minetest.register_craftitem("witchcraft:scroll_lightning", { inventory_image = "witchcraft_scroll.png^witchcraft_thunder_over.png", stack_max = 1, on_use = function(item, placer, pos) - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local dir = placer:get_look_dir(); lightning.strike({x=playerpos.x+dir.x*2,y=playerpos.y+0+dir.y,z=playerpos.z+dir.z*2}) item:take_item() @@ -2090,10 +2090,10 @@ minetest.register_craftitem("witchcraft:scroll_lightning", { stack_max = 1, on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*7,y=dir.y*7,z=dir.z*7} local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:lightning") - obj:setvelocity(vec) + obj:set_velocity(vec) item:take_item() return item @@ -2107,14 +2107,14 @@ minetest.register_craftitem("witchcraft:scroll_icicle", { stack_max = 1, on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*7,y=dir.y*7,z=dir.z*7} local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:ice") local obj2 = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+1+dir.z}, "witchcraft:ice") local obj3 = minetest.env:add_entity({x=playerpos.x+1+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:ice") - obj:setvelocity(vec) - obj2:setvelocity(vec) - obj3:setvelocity(vec) + obj:set_velocity(vec) + obj2:set_velocity(vec) + obj3:set_velocity(vec) item:take_item() return item @@ -2128,10 +2128,10 @@ minetest.register_craftitem("witchcraft:scroll_nature", { stack_max = 1, on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*6,y=dir.y*6,z=dir.z*6} local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:tree") - obj:setvelocity(vec) + obj:set_velocity(vec) item:take_item() return item @@ -2223,7 +2223,7 @@ minetest.register_entity("witchcraft:fireball", { local remove = minetest.after(2, function() self.object:remove() end) - local pos = self.object:getpos() + local pos = self.object:get_pos() local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) for k, obj in pairs(objs) do if obj:get_luaentity() ~= nil then @@ -2253,7 +2253,7 @@ minetest.register_entity("witchcraft:fireball", { end end hit_node = function(self, pos, node) --- local pos = self.object:getpos() +-- local pos = self.object:get_pos() for dx=-4,4 do for dy=-4,4 do for dz=-4,4 do @@ -2271,7 +2271,7 @@ minetest.register_entity("witchcraft:fireball", { end end - local apos = self.object:getpos() + local apos = self.object:get_pos() local part = minetest.add_particlespawner( 6, --amount 0.3, --time @@ -2301,7 +2301,7 @@ minetest.register_entity("witchcraft:lightning", { local remove = minetest.after(2, function() self.object:remove() end) - local pos = self.object:getpos() + local pos = self.object:get_pos() local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) for k, obj in pairs(objs) do if obj:get_luaentity() ~= nil then @@ -2332,7 +2332,7 @@ minetest.register_entity("witchcraft:lightning", { end end - local apos = self.object:getpos() + local apos = self.object:get_pos() local part = minetest.add_particlespawner( 6, --amount 0.3, --time @@ -2362,13 +2362,13 @@ minetest.register_entity("witchcraft:tree", { local remove = minetest.after(2, function() self.object:remove() end) - local pos = self.object:getpos() + local pos = self.object:get_pos() local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) for k, obj in pairs(objs) do if obj:get_luaentity() ~= nil then if obj:get_luaentity().name ~= "witchcraft:tree" and obj:get_luaentity().name ~= "__builtin:item" then obj:remove() - local treepos = self.object:getpos() + local treepos = self.object:get_pos() default.grow_new_jungle_tree(treepos) self.object:remove() end @@ -2381,7 +2381,7 @@ minetest.register_entity("witchcraft:tree", { local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} local n = minetest.env:get_node(p).name if n ~= "witchcraft:tree" and n ~="air" then - local treepos = self.object:getpos() + local treepos = self.object:get_pos() default.grow_new_jungle_tree(treepos) self.object:remove() elseif n == "default:wood" or n =="default:tree" or n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then @@ -2393,11 +2393,11 @@ minetest.register_entity("witchcraft:tree", { end end hit_node = function(self, pos, node) - local treepos = self.object:getpos() + local treepos = self.object:get_pos() default.grow_new_jungle_tree(treepos) end - local apos = self.object:getpos() + local apos = self.object:get_pos() local part = minetest.add_particlespawner( 6, --amount 0.3, --time @@ -2432,7 +2432,7 @@ minetest.register_entity("witchcraft:ice", { local remove = minetest.after(2, function() self.object:remove() end) - local pos = self.object:getpos() + local pos = self.object:get_pos() local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) for k, obj in pairs(objs) do if obj:get_luaentity() ~= nil then @@ -2445,7 +2445,7 @@ minetest.register_entity("witchcraft:ice", { end end - local apos = self.object:getpos() + local apos = self.object:get_pos() local part = minetest.add_particlespawner( 10, --amount 0.3, --time diff --git a/mods/witchcraft/scrolls.lua b/mods/witchcraft/scrolls.lua index 9102599..6fd0821 100644 --- a/mods/witchcraft/scrolls.lua +++ b/mods/witchcraft/scrolls.lua @@ -29,7 +29,7 @@ minetest.register_craftitem("witchcraft:scroll_wild", { inventory_image = "witchcraft_scroll.png^witchcraft_dark_over.png", stack_max = 1, on_use = function(item, placer) - local pos = placer:getpos(); + local pos = placer:get_pos(); minetest.env:add_entity(pos, "pmobs:dog") item:take_item() return item @@ -43,15 +43,15 @@ minetest.register_craftitem("witchcraft:scroll_fireball", { stack_max = 1, on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fireball") local obj2 = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fireball") local obj3 = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fireball") local obj4 = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fireball") - obj2:setvelocity({x=dir.x*7+0.5,y=dir.y*7,z=dir.z*7+0.5}) - obj3:setvelocity({x=dir.x*7-0.5,y=dir.y*7,z=dir.z*7-0.5}) - obj4:setvelocity({x=dir.x*7,y=dir.y*7-0.5,z=dir.z*7}) - obj:setvelocity({x=dir.x*7,y=dir.y*7+0.5,z=dir.z*7}) + obj2:set_velocity({x=dir.x*7+0.5,y=dir.y*7,z=dir.z*7+0.5}) + obj3:set_velocity({x=dir.x*7-0.5,y=dir.y*7,z=dir.z*7-0.5}) + obj4:set_velocity({x=dir.x*7,y=dir.y*7-0.5,z=dir.z*7}) + obj:set_velocity({x=dir.x*7,y=dir.y*7+0.5,z=dir.z*7}) item:take_item() return item end, @@ -63,7 +63,7 @@ minetest.register_craftitem("witchcraft:scroll_lightning", { inventory_image = "witchcraft_scroll.png^witchcraft_thunder_over.png", stack_max = 1, on_use = function(item, placer, pos) - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local dir = placer:get_look_dir(); lightning.strike({x=playerpos.x+dir.x*2,y=playerpos.y+0+dir.y,z=playerpos.z+dir.z*2}) item:take_item() @@ -78,14 +78,14 @@ minetest.register_craftitem("witchcraft:scroll_icicle", { stack_max = 1, on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*7,y=dir.y*7,z=dir.z*7} local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:ice") local obj2 = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+1+dir.z}, "witchcraft:ice") local obj3 = minetest.env:add_entity({x=playerpos.x+1+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:ice") - obj:setvelocity(vec) - obj2:setvelocity(vec) - obj3:setvelocity(vec) + obj:set_velocity(vec) + obj2:set_velocity(vec) + obj3:set_velocity(vec) item:take_item() return item @@ -99,10 +99,10 @@ minetest.register_craftitem("witchcraft:scroll_nature", { stack_max = 1, on_use = function(item, placer, pos) local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); + local playerpos = placer:get_pos(); local vec = {x=dir.x*6,y=dir.y*6,z=dir.z*6} local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:tree") - obj:setvelocity(vec) + obj:set_velocity(vec) item:take_item() return item @@ -221,7 +221,7 @@ minetest.register_entity("witchcraft:fireball", { local remove = minetest.after(2, function() self.object:remove() end) - local pos = self.object:getpos() + local pos = self.object:get_pos() local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) for k, obj in pairs(objs) do if obj:get_luaentity() ~= nil then @@ -251,7 +251,7 @@ minetest.register_entity("witchcraft:fireball", { end end hit_node = function(self, pos, node) --- local pos = self.object:getpos() +-- local pos = self.object:get_pos() for dx=-4,4 do for dy=-4,4 do for dz=-4,4 do @@ -269,8 +269,8 @@ minetest.register_entity("witchcraft:fireball", { end end - local apos = self.object:getpos() - local vec = self.object:getvelocity() + local apos = self.object:get_pos() + local vec = self.object:get_velocity() local part = minetest.add_particlespawner( 6, --amount 0.3, --time @@ -302,13 +302,13 @@ minetest.register_entity("witchcraft:tree", { local remove = minetest.after(2, function() self.object:remove() end) - local pos = self.object:getpos() + local pos = self.object:get_pos() local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) for k, obj in pairs(objs) do if obj:get_luaentity() ~= nil then if obj:get_luaentity().name ~= "witchcraft:tree" and obj:get_luaentity().name ~= "__builtin:item" then obj:remove() - local treepos = self.object:getpos() + local treepos = self.object:get_pos() default.grow_new_jungle_tree(treepos) self.object:remove() end @@ -321,7 +321,7 @@ minetest.register_entity("witchcraft:tree", { local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} local n = minetest.env:get_node(p).name if n ~= "witchcraft:tree" and n ~="air" then - local treepos = self.object:getpos() + local treepos = self.object:get_pos() default.grow_new_jungle_tree(treepos) self.object:remove() elseif n == "default:wood" or n =="default:tree" or n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then @@ -333,11 +333,11 @@ minetest.register_entity("witchcraft:tree", { end end hit_node = function(self, pos, node) - local treepos = self.object:getpos() + local treepos = self.object:get_pos() default.grow_new_jungle_tree(treepos) end - local apos = self.object:getpos() + local apos = self.object:get_pos() local part = minetest.add_particlespawner( 6, --amount 0.3, --time @@ -372,7 +372,7 @@ minetest.register_entity("witchcraft:ice", { local remove = minetest.after(10, function() self.object:remove() end) - local pos = self.object:getpos() + local pos = self.object:get_pos() local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) for k, obj in pairs(objs) do if obj:get_luaentity() ~= nil then @@ -391,12 +391,12 @@ minetest.register_entity("witchcraft:ice", { local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} local n = minetest.env:get_node(p).name if n == "default:water_source" or n =="default:river_water_source" then - local pos = self.object:getpos() + local pos = self.object:get_pos() minetest.set_node(pos, {name="default:ice"}) self.object:remove() elseif n ~= "air" then - local velo = self.object:getvelocity() - self.object:setvelocity({x=velo.x*-1, y=velo.y*0, z=velo.z*1}) + local velo = self.object:get_velocity() + self.object:set_velocity({x=velo.x*-1, y=velo.y*0, z=velo.z*1}) --self.object:remove() return end @@ -404,7 +404,7 @@ minetest.register_entity("witchcraft:ice", { end end - local apos = self.object:getpos() + local apos = self.object:get_pos() local part = minetest.add_particlespawner( 10, --amount 0.3, --time diff --git a/mods/workbench/init.lua b/mods/workbench/init.lua index 28fe6c7..7913220 100644 --- a/mods/workbench/init.lua +++ b/mods/workbench/init.lua @@ -326,6 +326,7 @@ for i=1, #nodes do drawtype = "nodebox", sounds = def.sounds, tiles = tiles, + use_texture_alpha = "clip", groups = groups, -- `unpack` has been changed to `table.unpack` in newest Lua versions. node_box = workbench:pixelbox(16, {unpack(d, 3)}), @@ -335,4 +336,3 @@ for i=1, #nodes do end end end - diff --git a/mods/xpanes/init.lua b/mods/xpanes/init.lua index fcfb328..b6f4c5d 100644 --- a/mods/xpanes/init.lua +++ b/mods/xpanes/init.lua @@ -101,7 +101,7 @@ function xpanes.register_pane(name, def) wield_image = def.wield_image, paramtype2 = "facedir", tiles = {def.textures[3], def.textures[3], def.textures[1]}, - use_texture_alpha = true, + use_texture_alpha = def.use_texture_alpha or "clip", groups = flatgroups, drop = "xpanes:" .. name .. "_flat", sounds = def.sounds, @@ -126,7 +126,7 @@ function xpanes.register_pane(name, def) sunlight_propagates = true, description = def.description, tiles = {def.textures[3], def.textures[3], def.textures[1]}, - use_texture_alpha = true, + use_texture_alpha = def.use_texture_alpha or "clip", groups = groups, drop = "xpanes:" .. name .. "_flat", sounds = def.sounds, @@ -203,7 +203,7 @@ xpanes.register_pane("lattice", { xpanes.register_pane("ice", { description = "ice pane", textures = {"xpanes_ice.png","xpanes_ice_half.png","xpanes_ice_half.png"}, - use_texture_alpha = true, + use_texture_alpha = "blend", inventory_image = "xpanes_ice.png", wield_image = "xpanes_ice.png", sounds = default.node_sound_glass_defaults(),