-- ================================================================ local sra = ocutil.safe_register_alias -- =================================================================== local amtiles_lava_source = { name = "default_lava_source_animated.png" , backface_culling = false , animation = { type = "vertical_frames" , aspect_w = 16 , aspect_h = 16 , length = 3.0 , } } -- =================================================================== local dps = 4 * 2 local groups = { lava=3, liquid=2, igniter=1, hot=3, not_in_creative_inventory=1 } if default.safe_lava then dps = 0 groups = { lava=3, liquid=2, not_in_creative_inventory=1 } end -- =================================================================== if not default.stop_lava then minetest.register_node ("default:lava_source", { description = "Lava Source" , light_source = default.LIGHT_MAX - 1 , paramtype = "light" , tiles = { amtiles_lava_source } , special_tiles = { amtiles_lava_source } , buildable_to = true , diggable = false , is_ground_content = false , pointable = false , walkable = false , damage_per_second = dps , drop = "" , drowning = 1 , drawtype = "liquid" , liquidtype = "source" , liquid_alternative_flowing = "default:lava_flowing" , liquid_alternative_source = "default:lava_source" , liquid_renewable = false , liquid_viscosity = 7 , groups = groups , post_effect_color = { a = 191, r = 255, g = 64, b = 0 } , after_place_node = function (pos, placer, itemstack, pointed_thing) if not minetest.check_player_privs (placer:get_player_name(), { lava = true }) then minetest.remove_node (pos) end end , }) end -- =================================================================== local amtiles_lava_flowing_bc0 = { name = "default_lava_flowing_animated.png" , backface_culling = false , animation = { type = "vertical_frames" , aspect_w = 16 , aspect_h = 16 , length = 3.3 , } } local amtiles_lava_flowing_bc1 = ocutil.clone_table (amtiles_lava_flowing_bc0) amtiles_lava_flowing_bc1.backface_culling = true -- =================================================================== if not default.stop_lava then minetest.register_node ("default:lava_flowing", { description = "Flowing Lava" , light_source = default.LIGHT_MAX - 1 , paramtype = "light" , paramtype2 = "flowingliquid" , tiles = { "default_lava.png" } , special_tiles = { amtiles_lava_flowing_bc0 , amtiles_lava_flowing_bc1 , } , buildable_to = true , diggable = false , is_ground_content = false , pointable = false , walkable = false , damage_per_second = 4 * 2 , drop = "" , drowning = 1 , drawtype = "flowingliquid" , liquidtype = "flowing" , liquid_alternative_flowing = "default:lava_flowing" , liquid_alternative_source = "default:lava_source" , liquid_renewable = false , liquid_viscosity = 7 , groups = groups , post_effect_color = { a = 191, r = 255, g = 64, b = 0 } , after_place_node = function (pos, placer, itemstack, pointed_thing) if not minetest.check_player_privs (placer:get_player_name(), { lava = true }) then minetest.remove_node (pos) end end , }) end -- =================================================================== -- Lava Crust comes in Source and Flowing forms like regular lava. -- It's partly cooled lava that has started to solidify. It's antici- -- pated that this type of lava will be used by mapgens that generate -- volcanos. -- Differences relative to other types of lava: -- -- Different appearance compared to regular lava -- Lava Crust Source is walkable (future change: add walk damage) -- Lava Crust Flowing has only limited flow (configurable distance) -- Not as hot as regular lava -- Removed "igniter" from groups -- =================================================================== -- There are two Lava Crust modes. They can be selected in "world. -- conf" as follows: -- -- remove_lava_crust = false -- Default mode -- remove_lava_crust = true -- Alternate behavior -- =================================================================== -- If the setting is false (this is the default mode): -- -- * Lava Crust Source can be scooped up using a bucket or dug normal- -- ly. Both steps transfer the node to inventory. -- -- * Lava Crust Slope can't be scooped up using a bucket. It can be -- dug normally, but this destroys the node. -- -- * If a Lava Crust Source Node is removed, associated Slope nodes -- remain. Note: They'll fall down because the Source node is no long- -- er there to support them. -- -- * This mode is the most natural one for survival worlds as opposed -- to creative worlds. -- =================================================================== -- If the setting is true: -- -- * Lava Crust Source can be scooped up using a bucket or dug using -- "icetools:pick_ice". The ice-pick dig turns the node into stone and -- transfers the node to inventory. The node can't be dug using normal -- tools. -- -- * Lava Crust Slope can't be scooped up using a bucket or dug using -- normal tools. It can dug using "icetools:pick_ice". The ice-pick -- dig turns the node into stone and transfers the stone to inven- -- tory. -- -- A dug Slope node will be replaced by the associated Source node. -- The new Slope node can then be dug and the cycle will repeat. So, -- one oddity in this mode is possession of an ice pick leads to an -- infinite supply of stone. -- -- * If a Lava Crust Source Node is removed, associated Slope nodes -- disappear. -- -- * Some builders working in creative worlds may prefer this mode to -- the default mode. -- =================================================================== -- The following unrelated setting can be used to set the flow range -- for Lava Crust: -- -- lava_crust_range = 2 -- -- A setting of 0 is permitted. The default setting is 2. The speci- -- fied setting is clipped, if necessary, to a sane range. -- =================================================================== local amtiles_lava_crust_source = { name = "default_lava_crust_source_animated.png" , backface_culling = false , animation = { type = "vertical_frames" , aspect_w = 16 , aspect_h = 16 , length = 3.3 , } } -- =================================================================== local remove_lava_crust = ocutil.bool_default ("remove_lava_crust", false) local keep_lava_crust = true if remove_lava_crust then keep_lava_crust = false end -- Note: 0 is truthy in Lua, so 0 is possible: lava_crust_range = tonumber (minetest.setting_get ("lava_crust_range")) or 2 lava_crust_source_drop = "" lava_crust_flowing_liquidtype = "flowing" lava_crust_source_groups = { lava = 3, liquid = 2, hot = 3 } if lava_crust_range < 0 then lava_crust_range = 0 end if lava_crust_range > 20 then lava_crust_range = 20 end -- =================================================================== lava_crust_flowing_groups = { lava=3, liquid=2, hot=3, not_in_creative_inventory=1 } if default.safe_lava then lava_crust_source_groups = { lava=3, liquid=2 } lava_crust_flowing_groups = { lava=3, liquid=2, not_in_creative_inventory=1 } end -- =================================================================== if keep_lava_crust then lava_crust_source_drop = "default:lava_crust_source" lava_crust_source_groups = { lava = 3, hot = 3, crumbly = 3, cracky = 3, } lava_crust_flowing_liquidtype = "none" lava_crust_flowing_groups = { lava = 3, hot = 3, crumbly = 3, cracky = 3, not_in_creative_inventory = 1, } end -- =================================================================== if default.stop_lava then default.convert_node ("default:lava_crust_source", "air") else minetest.register_node ("default:lava_crust_source", { description = "Lava Crust Source" , light_source = default.LIGHT_MAX - 1 , paramtype = "light" , tiles = { amtiles_lava_crust_source } , special_tiles = { amtiles_lava_crust_source } , buildable_to = true , diggable = keep_lava_crust , is_ground_content = false , pointable = keep_lava_crust , walkable = true , damage_per_second = 2 , drop = lava_crust_source_drop , drowning = 1 , -- This node doesn't set "liquid_range" -- drawtype = "liquid" , liquidtype = "source" , liquid_alternative_flowing = "default:lava_crust_flowing" , liquid_alternative_source = "default:lava_crust_source" , liquid_renewable = false , liquid_viscosity = 7 , groups = lava_crust_source_groups , post_effect_color = { a = 191, r = 255, g = 64, b = 0 } , }) end -- =================================================================== -- For the time being, the "flowing" version of this node intentional- -- ly uses the animation associated with the "source" version of this -- node. This is a special case but simply a matter of convenience. A -- separate "flowing" animation might or might not be done in the fu- -- ture. local amtiles_lava_crust_flowing_bc0 = ocutil.clone_table (amtiles_lava_crust_source) local amtiles_lava_crust_flowing_bc1 = ocutil.clone_table (amtiles_lava_crust_flowing_bc0) amtiles_lava_crust_flowing_bc1.backface_culling = true -- =================================================================== if default.stop_lava then default.convert_node ("default:lava_crust_flowing", "air") else minetest.register_node ("default:lava_crust_flowing", { description = "Lava Crust Flowing" , light_source = default.LIGHT_MAX - 1 , paramtype = "light" , paramtype2 = "flowingliquid" , tiles = { "default_lava_crust.png" } , special_tiles = { amtiles_lava_crust_flowing_bc0 , amtiles_lava_crust_flowing_bc1 , } , buildable_to = true , diggable = keep_lava_crust , is_ground_content = false , pointable = keep_lava_crust , walkable = true , damage_per_second = 2 , drop = "" , drowning = 1 , drawtype = "flowingliquid" , liquidtype = lava_crust_flowing_liquidtype , liquid_alternative_flowing = "default:lava_crust_flowing" , liquid_alternative_source = "default:lava_crust_source" , liquid_range = lava_crust_range , liquid_renewable = false , liquid_viscosity = 7 , groups = lava_crust_flowing_groups , post_effect_color = { a = 191, r = 255, g = 64, b = 0 } , }) end -- =================================================================== -- Lava Gel is similar to regular lava, but it doesn't generate more -- lava or flow. Like Water Gel, it's suitable for use as a building -- material. A relatively dangerous one. -- Presently, Lava Source that's scooped into a bucket turns into Lava -- Gel. Note: This is the primary place that Lava Gel comes from other -- than WorldEdit. -- Additionally, Lava Source has been removed from Creative Inventory. -- These steps should reduce one of the most problematic types of -- griefing. -- If you'd like to disable the feature where buckets gel Lava Source, -- add this setting to "world.conf": -- -- bucket_gels_lava = false -- Lava Gel has a full cube size. -- Lava Gel can be scooped up using a bucket or dug using "icetools: -- pick_ice". The ice-pick dig turns the node into stone and trans- -- fers the stone to inventory. The node can't be dug using normal -- tools. -- =================================================================== minetest.register_node ("default:lava_gel", { description = "Lava Gel" , light_source = default.LIGHT_MAX - 1 , paramtype = "light" , tiles = { amtiles_lava_source } , special_tiles = { amtiles_lava_source } , buildable_to = true , diggable = false , is_ground_content = false , pointable = false , walkable = false , damage_per_second = 4 * 2 , drop = "" , drowning = 1 , drawtype = "liquid" , liquidtype = "source" , liquid_viscosity = 7 , liquid_range = 0 , liquid_renewable = false , liquid_alternative_flowing = "default:lava_gel_slope" , liquid_alternative_source = "default:lava_gel" , groups = { lava = 3, liquid = 2, hot = 3, } , }) -- =================================================================== if default.stop_lava then sra ("default:lava_source" , "default:lava_gel") sra ("default:lava_flowing" , "default:lava_gel") end -- =================================================================== -- Lava Gel Slope, like Lava Gel, is an alternative type of lava in- -- troduced for anti-griefing and/or building purposes. -- Lava Gel Slope is used with Lava Gel but it doesn't come from Lava -- Gel. Presently, it comes only from WorldEdit, but it could be added -- to Creative or possibly to crafting recipes. -- The purpose of Lava Gel Slope is to add slopes to the edges of -- structures made out of Lava Gel cubes. If a Lava Gel Slope is pla- -- ced next to a Lava Gel cube, the Slope connects in a natural manner -- to the cube. -- Lava Gel Slope has some liquid-like attributes, but it isn't a liq- -- uid. It doesn't flow. -- Lava Gel Slope can't be scooped into a bucket or dug using normal -- tools. It can be dug using "icetools:pick_ice". The ice-pick dig -- turns the node into stone and transfers the stone to inventory. -- =================================================================== minetest.register_node ("default:lava_gel_slope", { description = "Lava Gel Slope" , light_source = default.LIGHT_MAX - 1 , paramtype = "light" , tiles = { "default_lava.png" } , special_tiles = { amtiles_lava_flowing_bc0 , amtiles_lava_flowing_bc1 , } , buildable_to = true , diggable = true , is_ground_content = false , pointable = true , walkable = false , damage_per_second = 4 * 2 , drop = "default:lava_gel_slope" , drowning = 1 , drawtype = "flowingliquid" , liquidtype = "none" , liquid_viscosity = 7 , liquid_range = 0 , liquid_renewable = false , liquid_alternative_flowing = "default:lava_gel_slope" , liquid_alternative_source = "default:lava_gel" , groups = { lava = 3, liquid = 2, hot = 3 } , }) -- =================================================================== -- End of module.