configurable duration for crate markers

This commit is contained in:
FaceDeer 2017-11-17 18:49:43 -07:00
parent 123e470544
commit 1de57191b0
4 changed files with 13 additions and 6 deletions

@ -57,3 +57,7 @@ setting("float", "build_cost", 1.0, "Build cost")
-- With 100, the battery is 2.5 better than a coal lump, yet 3.7 less powerful than a coal block -- With 100, the battery is 2.5 better than a coal lump, yet 3.7 less powerful than a coal block
-- Being rechargeable should pay off for this "average" performance. -- Being rechargeable should pay off for this "average" performance.
setting("int", "power_ratio", 100, "The electrical charge to 1 coal heat unit conversion ratio") setting("int", "power_ratio", 100, "The electrical charge to 1 coal heat unit conversion ratio")
setting("float", "marker_crate_good_duration", 3.0, "Duration that 'good' crate markers last")
setting("float", "marker_crate_bad_duration", 9.0, "Duration that 'bad' crate markers last")

@ -60,7 +60,7 @@ minetest.register_entity("digtron:marker_crate_good", {
}, },
on_activate = function(self, staticdata) on_activate = function(self, staticdata)
minetest.after(5.0, minetest.after(digtron.config.marker_crate_good_duration,
function(self) function(self)
self.object:remove() self.object:remove()
end, end,
@ -86,7 +86,7 @@ minetest.register_entity("digtron:marker_crate_bad", {
}, },
on_activate = function(self, staticdata) on_activate = function(self, staticdata)
minetest.after(5.0, minetest.after(digtron.config.marker_crate_bad_duration,
function(self) function(self)
self.object:remove() self.object:remove()
end, end,

@ -20,6 +20,9 @@ digtron_traction_factor (Digtron traction factor) float 3.0 0.0 1000.0
#The maximum extrusion setting permitted for a Digtron builder module. #The maximum extrusion setting permitted for a Digtron builder module.
digtron_maximum_extrusion (Digtron maximum extrusion) int 25 1 100 digtron_maximum_extrusion (Digtron maximum extrusion) int 25 1 100
digtron_marker_crate_good_duration (Duration that 'good' crate markers last) float 3.0 0.0 100.0
digtron_marker_crate_bad_duration (Duration that 'bad' crate markers last) float 9.0 0.0 100.0
[Fuel costs] [Fuel costs]
#eg, stone. #eg, stone.

@ -114,8 +114,8 @@ digtron.item_place_node = function(itemstack, placer, place_to, param2)
if minetest.registered_nodes[item_name] == nil then if minetest.registered_nodes[item_name] == nil then
-- Permitted craft items are handled by the node-specific on_place call, above. -- Permitted craft items are handled by the node-specific on_place call, above.
-- if we are a craft item and we get here then we're not whitelisted and we should fail. -- if we are a craft item and we get here then we're not whitelisted and we should fail.
-- Note that builders should be filtering out craft items like this, but this will protect us -- Note that builder settings should be filtering out craft items like this before we get here,
-- just in case. -- but this will protect us just in case.
return itemstack, false return itemstack, false
end end