diff --git a/basic_machines/forceload.lua b/basic_machines/forceload.lua index 91aefb9..e36771a 100644 --- a/basic_machines/forceload.lua +++ b/basic_machines/forceload.lua @@ -61,21 +61,24 @@ local function postload_area(pos) end local function add_pos(pos, player) - local lPos = minetest.deserialize(player:get_attribute("techage_forceload_blocks")) or {} + local meta = player:get_meta() + local lPos = minetest.deserialize(meta:get_string("techage_forceload_blocks")) or {} if not in_list(lPos, pos) and (#lPos < techage.max_num_forceload_blocks or creative and creative.is_enabled_for and creative.is_enabled_for(player:get_player_name())) then lPos[#lPos+1] = pos - player:set_attribute("techage_forceload_blocks", minetest.serialize(lPos)) + local meta = player:get_meta() + meta:set_string("techage_forceload_blocks", minetest.serialize(lPos)) return true end return false end local function del_pos(pos, player) - local lPos = minetest.deserialize(player:get_attribute("techage_forceload_blocks")) or {} + local meta = player:get_meta() + local lPos = minetest.deserialize(meta:get_string("techage_forceload_blocks")) or {} lPos = remove_list_elem(lPos, pos) - player:set_attribute("techage_forceload_blocks", minetest.serialize(lPos)) + player:set_string("techage_forceload_blocks", minetest.serialize(lPos)) end local function get_pos_list(player) @@ -100,7 +103,8 @@ end local function get_data(pos, player) local pos1, pos2 = calc_area(pos) - local num = #minetest.deserialize(player:get_attribute("techage_forceload_blocks")) or 0 + local meta = player:get_meta() + local num = #minetest.deserialize(meta:get_string("techage_forceload_blocks")) or 0 local max = techage.max_num_forceload_blocks return pos1, pos2, num, max end diff --git a/basic_machines/quarry.lua b/basic_machines/quarry.lua index ee938e3..22ebfa1 100644 --- a/basic_machines/quarry.lua +++ b/basic_machines/quarry.lua @@ -347,7 +347,7 @@ local tubing = { end, on_push_item = function(pos, in_dir, stack) local meta = minetest.get_meta(pos) - if meta:get_int("push_dir") == in_dir or in_dir == 5 then + if meta:get_int("push_dir") == in_dir or in_dir == 5 then local inv = M(pos):get_inventory() --CRD(pos).State:start_if_standby(pos) -- would need power! return techage.put_items(inv, "main", stack) diff --git a/basis/mark2.lua b/basis/mark2.lua index 99ac668..7ea7e12 100644 --- a/basis/mark2.lua +++ b/basis/mark2.lua @@ -70,7 +70,7 @@ minetest.register_entity(":techage:position_cube", { "techage_cube_mark.png", "techage_cube_mark.png", }, - --use_texture_alpha = true, + use_texture_alpha = true, physical = false, visual_size = {x = 1.1, y = 1.1}, collisionbox = {-0.55,-0.55,-0.55, 0.55,0.55,0.55}, diff --git a/basis/node_states.lua b/basis/node_states.lua index e44c4fb..30b87fa 100644 --- a/basis/node_states.lua +++ b/basis/node_states.lua @@ -408,6 +408,7 @@ function NodeStates:keep_running(pos, nvm, val) self:start(pos, nvm) end nvm.techage_countdown = val or 4 + nvm.last_active = minetest.get_gametime() end -- Start/stop node based on button events. @@ -450,6 +451,11 @@ function NodeStates:on_receive_message(pos, topic, payload) local node = minetest.get_node(pos) if node.name == "ignore" then -- unloaded node? return "unloaded" + elseif nvm.techage_state == RUNNING then + local ttl = (nvm.last_active or 0) + 2 * (self.cycle_time or 0) + if ttl < minetest.get_gametime() then + return "inactive" + end end return techage.get_state_string(techage.get_nvm(pos)) elseif topic == "fuel" then diff --git a/init.lua b/init.lua index 0e9e3e4..1f14a6e 100644 --- a/init.lua +++ b/init.lua @@ -39,7 +39,8 @@ elseif minetest.global_exists("safer_lua") and safer_lua.version < 1.0 then end -- Test MT 5.4 new string mode -techage.CLIP = minetest.features.use_texture_alpha_string_modes and "clip" or true +techage.CLIP = minetest.features.use_texture_alpha_string_modes and "clip" or false +techage.BLEND = minetest.features.use_texture_alpha_string_modes and "blend" or true techage.NodeDef = {} -- node registration info diff --git a/iron_age/coalburner.lua b/iron_age/coalburner.lua index 25ba0b0..bd2db0d 100644 --- a/iron_age/coalburner.lua +++ b/iron_age/coalburner.lua @@ -133,7 +133,7 @@ for idx,ratio in ipairs(lRatio) do end, drawtype = "glasslike", - use_texture_alpha = true, + use_texture_alpha = techage.BLEND, inventory_image = "techage_flame.png", paramtype = "light", light_source = 13, diff --git a/iron_age/recipes.lua b/iron_age/recipes.lua index 1b411e7..af1e1ec 100644 --- a/iron_age/recipes.lua +++ b/iron_age/recipes.lua @@ -35,7 +35,7 @@ techage.ironage_register_recipe({ minetest.register_craftitem("techage:iron_ingot", { description = S("TA1 Iron Ingot"), inventory_image = "techage_iron_ingot.png", - use_texture_alpha = true, + use_texture_alpha = techage.CLIP, }) local function check_protection(pos, name, text) diff --git a/items/basalt.lua b/items/basalt.lua index 319d5ed..e65d9a7 100644 --- a/items/basalt.lua +++ b/items/basalt.lua @@ -131,7 +131,7 @@ minetest.register_node("techage:basalt_glass", { description = S("Basalt Glass"), drawtype = "glasslike_framed_optional", tiles = {"techage_basalt_glass.png"}, - use_texture_alpha = true, + use_texture_alpha = techage.BLEND, paramtype = "light", paramtype2 = "glasslikeliquidlevel", sunlight_propagates = true, @@ -155,7 +155,7 @@ minetest.register_node("techage:basalt_glass2", { description = S("Basalt Glass 2"), drawtype = "glasslike_framed_optional", tiles = {"techage_basalt_glass2.png"}, - use_texture_alpha = true, + use_texture_alpha = techage.BLEND, paramtype = "light", paramtype2 = "glasslikeliquidlevel", sunlight_propagates = true, @@ -185,7 +185,7 @@ minetest.register_node("techage:basalt_glass_thin", { }, }, tiles = {"techage_basalt_glass.png"}, - use_texture_alpha = true, + use_texture_alpha = techage.BLEND, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, @@ -204,7 +204,7 @@ minetest.register_node("techage:basalt_glass_thin2", { }, }, tiles = {"techage_basalt_glass2.png"}, - use_texture_alpha = true, + use_texture_alpha = techage.BLEND, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, @@ -223,7 +223,7 @@ minetest.register_node("techage:basalt_glass_thin_xl", { }, }, tiles = {"techage_basalt_glass.png"}, - use_texture_alpha = true, + use_texture_alpha = techage.BLEND, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, @@ -242,7 +242,7 @@ minetest.register_node("techage:basalt_glass_thin_xl2", { }, }, tiles = {"techage_basalt_glass2.png"}, - use_texture_alpha = true, + use_texture_alpha = techage.BLEND, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, diff --git a/logic/doorblock.lua b/logic/doorblock.lua index 3f7bd15..c29bea1 100644 --- a/logic/doorblock.lua +++ b/logic/doorblock.lua @@ -87,7 +87,7 @@ for idx,pgn in ipairs(tPgns) do paramtype = "light", paramtype2 = "facedir", - use_texture_alpha = true, + use_texture_alpha = techage.CLIP, sunlight_propagates = true, sounds = default.node_sound_stone_defaults(), groups = {cracky=2, choppy=2, crumbly=2, techage_door = 1, diff --git a/logic/gateblock.lua b/logic/gateblock.lua index 93a7bec..ba1e7a4 100644 --- a/logic/gateblock.lua +++ b/logic/gateblock.lua @@ -73,7 +73,7 @@ for idx,pgn in ipairs(tPgns) do paramtype = "light", paramtype2 = "facedir", - use_texture_alpha = true, + use_texture_alpha = techage.CLIP, sunlight_propagates = true, sounds = default.node_sound_stone_defaults(), groups = {cracky=2, choppy=2, crumbly=2, techage_door = 1, diff --git a/oil/gasflare.lua b/oil/gasflare.lua index 7df4fad..b8e0b0b 100644 --- a/oil/gasflare.lua +++ b/oil/gasflare.lua @@ -74,7 +74,7 @@ for idx,ratio in ipairs(lRatio) do end end, - use_texture_alpha = true, + use_texture_alpha = techage.BLEND, inventory_image = "techage_flame.png", paramtype = "light", light_source = 13, diff --git a/tools/trowel.lua b/tools/trowel.lua index a44e590..6e895fe 100644 --- a/tools/trowel.lua +++ b/tools/trowel.lua @@ -89,7 +89,7 @@ minetest.register_tool("techage:trowel", { description = S("TechAge Trowel"), inventory_image = "techage_trowel.png", wield_image = "techage_trowel.png", - use_texture_alpha = true, + use_texture_alpha = techage.CLIP, groups = {cracky=1}, on_use = replace_node, on_place = replace_node,