Compare commits
5 Commits
c2307b8816
...
ecdbbda344
Author | SHA1 | Date |
---|---|---|
Jordan Snelling | ecdbbda344 | |
paramat | 1cc8300ba9 | |
paramat | fd5721faa8 | |
paramat | 09d910efcb | |
paramat | acb0cecb36 |
|
@ -110,7 +110,7 @@ minetest.register_craftitem("bucket:bucket_empty", {
|
|||
inventory_image = "bucket.png",
|
||||
stack_max = 99,
|
||||
liquids_pointable = true,
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
on_place = function(itemstack, user, pointed_thing)
|
||||
-- Must be pointing to node
|
||||
if pointed_thing.type ~= "node" then
|
||||
return
|
||||
|
|
|
@ -332,6 +332,7 @@ function default.register_biomes()
|
|||
node_water_top = "default:ice",
|
||||
depth_water_top = 10,
|
||||
--node_water = "",
|
||||
node_river_water = "default:ice",
|
||||
y_min = -8,
|
||||
y_max = 31000,
|
||||
heat_point = -5,
|
||||
|
@ -349,6 +350,7 @@ function default.register_biomes()
|
|||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
--node_river_water = "",
|
||||
y_min = -112,
|
||||
y_max = -9,
|
||||
heat_point = -5,
|
||||
|
@ -368,6 +370,7 @@ function default.register_biomes()
|
|||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
--node_river_water = "",
|
||||
y_min = 2,
|
||||
y_max = 31000,
|
||||
heat_point = 20,
|
||||
|
@ -385,6 +388,7 @@ function default.register_biomes()
|
|||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
--node_river_water = "",
|
||||
y_min = -112,
|
||||
y_max = 1,
|
||||
heat_point = 20,
|
||||
|
@ -402,6 +406,7 @@ function default.register_biomes()
|
|||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
--node_river_water = "",
|
||||
y_min = 2,
|
||||
y_max = 31000,
|
||||
heat_point = 20,
|
||||
|
@ -419,6 +424,7 @@ function default.register_biomes()
|
|||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
--node_river_water = "",
|
||||
y_min = -112,
|
||||
y_max = 1,
|
||||
heat_point = 20,
|
||||
|
@ -438,6 +444,7 @@ function default.register_biomes()
|
|||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
--node_river_water = "",
|
||||
y_min = 6,
|
||||
y_max = 31000,
|
||||
heat_point = 45,
|
||||
|
@ -455,6 +462,7 @@ function default.register_biomes()
|
|||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
--node_river_water = "",
|
||||
y_min = -112,
|
||||
y_max = 5,
|
||||
heat_point = 45,
|
||||
|
@ -472,6 +480,7 @@ function default.register_biomes()
|
|||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
--node_river_water = "",
|
||||
y_min = 6,
|
||||
y_max = 31000,
|
||||
heat_point = 45,
|
||||
|
@ -489,6 +498,7 @@ function default.register_biomes()
|
|||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
--node_river_water = "",
|
||||
y_min = -112,
|
||||
y_max = 5,
|
||||
heat_point = 45,
|
||||
|
@ -508,6 +518,7 @@ function default.register_biomes()
|
|||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
--node_river_water = "",
|
||||
y_min = 6,
|
||||
y_max = 31000,
|
||||
heat_point = 70,
|
||||
|
@ -525,6 +536,7 @@ function default.register_biomes()
|
|||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
--node_river_water = "",
|
||||
y_min = -112,
|
||||
y_max = 5,
|
||||
heat_point = 70,
|
||||
|
@ -542,6 +554,7 @@ function default.register_biomes()
|
|||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
--node_river_water = "",
|
||||
y_min = 6,
|
||||
y_max = 31000,
|
||||
heat_point = 70,
|
||||
|
@ -559,6 +572,7 @@ function default.register_biomes()
|
|||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
--node_river_water = "",
|
||||
y_min = -112,
|
||||
y_max = 5,
|
||||
heat_point = 70,
|
||||
|
@ -578,6 +592,7 @@ function default.register_biomes()
|
|||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
--node_river_water = "",
|
||||
y_min = 5,
|
||||
y_max = 31000,
|
||||
heat_point = 95,
|
||||
|
@ -595,6 +610,7 @@ function default.register_biomes()
|
|||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
--node_river_water = "",
|
||||
y_min = -112,
|
||||
y_max = 4,
|
||||
heat_point = 95,
|
||||
|
@ -612,6 +628,7 @@ function default.register_biomes()
|
|||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
--node_river_water = "",
|
||||
y_min = 5,
|
||||
y_max = 31000,
|
||||
heat_point = 95,
|
||||
|
@ -629,6 +646,7 @@ function default.register_biomes()
|
|||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
--node_river_water = "",
|
||||
y_min = -112,
|
||||
y_max = 4,
|
||||
heat_point = 95,
|
||||
|
@ -646,6 +664,7 @@ function default.register_biomes()
|
|||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
--node_river_water = "",
|
||||
y_min = 1,
|
||||
y_max = 31000,
|
||||
heat_point = 95,
|
||||
|
@ -663,6 +682,7 @@ function default.register_biomes()
|
|||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
--node_river_water = "",
|
||||
y_min = 0,
|
||||
y_max = 0,
|
||||
heat_point = 95,
|
||||
|
@ -680,6 +700,7 @@ function default.register_biomes()
|
|||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
--node_river_water = "",
|
||||
y_min = -112,
|
||||
y_max = -1,
|
||||
heat_point = 95,
|
||||
|
@ -699,6 +720,7 @@ function default.register_biomes()
|
|||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
--node_river_water = "",
|
||||
y_min = -31000,
|
||||
y_max = -113,
|
||||
heat_point = 50,
|
||||
|
|
Binary file not shown.
|
@ -16,11 +16,13 @@ minetest.register_node("fire:basic_flame", {
|
|||
aspect_w = 16, aspect_h = 16, length = 1},
|
||||
}},
|
||||
inventory_image = "fire_basic_flame.png",
|
||||
paramtype = "light",
|
||||
light_source = 14,
|
||||
groups = {igniter = 2, dig_immediate = 3},
|
||||
drop = '',
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
sunlight_propagates = true,
|
||||
damage_per_second = 4,
|
||||
|
||||
on_construct = function(pos)
|
||||
|
@ -31,21 +33,13 @@ minetest.register_node("fire:basic_flame", {
|
|||
minetest.after(0, fire.on_flame_remove_at, pos)
|
||||
end,
|
||||
|
||||
-- unaffected by explosions
|
||||
on_blast = function() end,
|
||||
on_blast = function() end, -- unaffected by explosions
|
||||
})
|
||||
|
||||
|
||||
-- Fire sounds table
|
||||
-- key: position hash of low corner of area
|
||||
-- value: {handle=sound handle, name=sound name}
|
||||
fire.sounds = {}
|
||||
|
||||
|
||||
-- Get sound area of position
|
||||
|
||||
-- size of sound areas
|
||||
fire.D = 6
|
||||
fire.D = 6 -- size of sound areas
|
||||
|
||||
function fire.get_area_p0p1(pos)
|
||||
local p0 = {
|
||||
|
@ -62,6 +56,12 @@ function fire.get_area_p0p1(pos)
|
|||
end
|
||||
|
||||
|
||||
-- Fire sounds table
|
||||
-- key: position hash of low corner of area
|
||||
-- value: {handle=sound handle, name=sound name}
|
||||
fire.sounds = {}
|
||||
|
||||
|
||||
-- Update fire sounds in sound area of position
|
||||
|
||||
function fire.update_sounds_around(pos)
|
||||
|
@ -73,9 +73,9 @@ function fire.update_sounds_around(pos)
|
|||
local should_have_sound = (#flames_p > 0)
|
||||
local wanted_sound = nil
|
||||
if #flames_p >= 9 then
|
||||
wanted_sound = {name = "fire_large", gain = 1.5}
|
||||
wanted_sound = {name = "fire_large", gain = 0.7}
|
||||
elseif #flames_p > 0 then
|
||||
wanted_sound = {name = "fire_small", gain = 1.5}
|
||||
wanted_sound = {name = "fire_small", gain = 0.9}
|
||||
end
|
||||
local p0_hash = minetest.hash_node_position(p0)
|
||||
local sound = fire.sounds[p0_hash]
|
||||
|
@ -125,33 +125,84 @@ end
|
|||
-- Detect nearby extinguishing nodes
|
||||
|
||||
function fire.flame_should_extinguish(pos)
|
||||
if minetest.setting_getbool("disable_fire") then return true end
|
||||
--return minetest.find_node_near(pos, 1, {"group:puts_out_fire"})
|
||||
local p0 = {x = pos.x - 1, y = pos.y, z = pos.z - 1}
|
||||
local p1 = {x = pos.x + 1, y = pos.y + 1, z = pos.z + 1}
|
||||
local ps = minetest.find_nodes_in_area(p0, p1, {"group:puts_out_fire"})
|
||||
return (#ps ~= 0)
|
||||
return minetest.find_node_near(pos, 1, {"group:puts_out_fire"})
|
||||
end
|
||||
|
||||
|
||||
-- Ignite neighboring nodes
|
||||
-- Enable ABMs according to 'disable fire' setting
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"group:flammable"},
|
||||
neighbors = {"group:igniter"},
|
||||
interval = 7,
|
||||
chance = 32,
|
||||
action = function(p0, node, _, _)
|
||||
-- If there is water or stuff like that around flame, don't ignite
|
||||
if fire.flame_should_extinguish(p0) then
|
||||
return
|
||||
end
|
||||
local p = fire.find_pos_for_flame_around(p0)
|
||||
if p then
|
||||
minetest.set_node(p, {name = "fire:basic_flame"})
|
||||
end
|
||||
end,
|
||||
})
|
||||
if minetest.setting_getbool("disable_fire") then
|
||||
|
||||
-- Extinguish flames quickly with dedicated ABM
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"fire:basic_flame"},
|
||||
interval = 3,
|
||||
chance = 2,
|
||||
action = function(p0, node, _, _)
|
||||
minetest.remove_node(p0)
|
||||
end,
|
||||
})
|
||||
|
||||
else
|
||||
|
||||
-- Extinguish flames quickly with water, snow, ice
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"fire:basic_flame"},
|
||||
neighbors = {"group:puts_out_fire"},
|
||||
interval = 3,
|
||||
chance = 2,
|
||||
action = function(p0, node, _, _)
|
||||
minetest.remove_node(p0)
|
||||
minetest.sound_play("fire_extinguish_flame",
|
||||
{pos = p0, max_hear_distance = 16, gain = 0.25})
|
||||
end,
|
||||
})
|
||||
|
||||
-- Ignite neighboring nodes
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"group:flammable"},
|
||||
neighbors = {"group:igniter"},
|
||||
interval = 7,
|
||||
chance = 16,
|
||||
action = function(p0, node, _, _)
|
||||
-- If there is water or stuff like that around node, don't ignite
|
||||
if fire.flame_should_extinguish(p0) then
|
||||
return
|
||||
end
|
||||
local p = fire.find_pos_for_flame_around(p0)
|
||||
if p then
|
||||
minetest.set_node(p, {name = "fire:basic_flame"})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Remove flames and flammable nodes
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"fire:basic_flame"},
|
||||
interval = 5,
|
||||
chance = 16,
|
||||
action = function(p0, node, _, _)
|
||||
-- If there are no flammable nodes around flame, remove flame
|
||||
if not minetest.find_node_near(p0, 1, {"group:flammable"}) then
|
||||
minetest.remove_node(p0)
|
||||
return
|
||||
end
|
||||
if math.random(1, 4) == 1 then
|
||||
-- remove flammable nodes around flame
|
||||
local p = minetest.find_node_near(p0, 1, {"group:flammable"})
|
||||
if p then
|
||||
minetest.remove_node(p)
|
||||
nodeupdate(p)
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
|
||||
-- Rarely ignite things from far
|
||||
|
@ -184,44 +235,3 @@ minetest.register_abm({
|
|||
end,
|
||||
})
|
||||
--]]
|
||||
|
||||
|
||||
-- Remove flammable nodes and flame
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"fire:basic_flame"},
|
||||
interval = 5,
|
||||
chance = 16,
|
||||
action = function(p0, node, _, _)
|
||||
-- If there is water or stuff like that around flame, remove flame
|
||||
if fire.flame_should_extinguish(p0) then
|
||||
minetest.remove_node(p0)
|
||||
return
|
||||
end
|
||||
-- Make the following things rarer
|
||||
if math.random(1, 3) == 1 then
|
||||
return
|
||||
end
|
||||
-- If there are no flammable nodes around flame, remove flame
|
||||
if not minetest.find_node_near(p0, 1, {"group:flammable"}) then
|
||||
minetest.remove_node(p0)
|
||||
return
|
||||
end
|
||||
if math.random(1, 4) == 1 then
|
||||
-- remove a flammable node around flame
|
||||
local p = minetest.find_node_near(p0, 1, {"group:flammable"})
|
||||
if p then
|
||||
-- If there is water or stuff like that around flame, don't remove
|
||||
if fire.flame_should_extinguish(p0) then
|
||||
return
|
||||
end
|
||||
minetest.remove_node(p)
|
||||
nodeupdate(p)
|
||||
end
|
||||
else
|
||||
-- remove flame
|
||||
minetest.remove_node(p0)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -39,6 +39,7 @@ local function add_simple_flower(name, desc, box, f_groups)
|
|||
minetest.register_node("flowers:" .. name, {
|
||||
description = desc,
|
||||
drawtype = "plantlike",
|
||||
waving = 1,
|
||||
tiles = {"flowers_" .. name .. ".png"},
|
||||
inventory_image = "flowers_" .. name .. ".png",
|
||||
wield_image = "flowers_" .. name .. ".png",
|
||||
|
|
Loading…
Reference in New Issue