develop #35
23 changed files with 144 additions and 31 deletions
|
@ -200,6 +200,10 @@ armor.update_player_visuals = function(self, player)
|
||||||
self:run_callbacks("on_update", player)
|
self:run_callbacks("on_update", player)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- armor is not visible on player model if enabled
|
||||||
|
local transparent_armor = minetest.settings:get_bool("armor_transparent", false)
|
||||||
|
|
||||||
armor.set_player_armor = function(self, player)
|
armor.set_player_armor = function(self, player)
|
||||||
local name, armor_inv = self:get_valid_player(player, "[set_player_armor]")
|
local name, armor_inv = self:get_valid_player(player, "[set_player_armor]")
|
||||||
if not name then
|
if not name then
|
||||||
|
@ -258,7 +262,9 @@ armor.set_player_armor = function(self, player)
|
||||||
tex = tex:gsub(".png$", "")
|
tex = tex:gsub(".png$", "")
|
||||||
local prev = def.preview or tex.."_preview"
|
local prev = def.preview or tex.."_preview"
|
||||||
prev = prev:gsub(".png$", "")
|
prev = prev:gsub(".png$", "")
|
||||||
texture = texture.."^"..tex..".png"
|
if not transparent_armor then
|
||||||
|
texture = texture.."^"..tex..".png"
|
||||||
|
end
|
||||||
preview = preview.."^"..prev..".png"
|
preview = preview.."^"..prev..".png"
|
||||||
state = state + stack:get_wear()
|
state = state + stack:get_wear()
|
||||||
count = count + 1
|
count = count + 1
|
||||||
|
|
|
@ -49,7 +49,7 @@ unified_inventory.register_page("armor", {
|
||||||
"listring[current_player;main]"..
|
"listring[current_player;main]"..
|
||||||
"listring[detached:"..name.."_armor;armor]"
|
"listring[detached:"..name.."_armor;armor]"
|
||||||
if armor.config.fire_protect then
|
if armor.config.fire_protect then
|
||||||
formspec = formspec.."label[5.0,"..(fy + 1.0)..";"..
|
formspec = formspec.."label[6.0,"..(fy + 1.0)..";"..
|
||||||
F(S("Fire"))..": "..armor.def[name].fire.."]"
|
F(S("Fire"))..": "..armor.def[name].fire.."]"
|
||||||
end
|
end
|
||||||
if has_technic then
|
if has_technic then
|
||||||
|
|
|
@ -58,6 +58,9 @@ armor_punch_damage (Enable damage effects) bool true
|
||||||
# Enable migration of old armor inventories.
|
# Enable migration of old armor inventories.
|
||||||
armor_migrate_old_inventory (Migrate old armor inventories) bool true
|
armor_migrate_old_inventory (Migrate old armor inventories) bool true
|
||||||
|
|
||||||
|
# Don't show armor on character model.
|
||||||
|
armor_transparent (Transparent armor) bool false
|
||||||
|
|
||||||
|
|
||||||
[shields]
|
[shields]
|
||||||
|
|
||||||
|
|
|
@ -1106,6 +1106,17 @@ function advtrains.split_train_at_index(train, index)
|
||||||
local newtrain=advtrains.trains[newtrain_id]
|
local newtrain=advtrains.trains[newtrain_id]
|
||||||
|
|
||||||
newtrain.velocity=train.velocity
|
newtrain.velocity=train.velocity
|
||||||
|
-- copy various properties from the old to the new train
|
||||||
|
newtrain.door_open = train.door_open
|
||||||
|
newtrain.text_outside = train.text_outside
|
||||||
|
newtrain.text_inside = train.text_inside
|
||||||
|
newtrain.line = train.line
|
||||||
|
newtrain.routingcode = train.routingcode
|
||||||
|
newtrain.speed_restriction = train.speed_restriction
|
||||||
|
newtrain.is_shunt = train.is_shunt
|
||||||
|
newtrain.points_split = advtrains.merge_tables(train.points_split)
|
||||||
|
newtrain.autocouple = train.autocouple
|
||||||
|
|
||||||
return newtrain_id -- return new train ID, so new train can be manipulated
|
return newtrain_id -- return new train ID, so new train can be manipulated
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -35,15 +35,10 @@ function cart_entity:on_rightclick(clicker)
|
||||||
end
|
end
|
||||||
local player_name = clicker:get_player_name()
|
local player_name = clicker:get_player_name()
|
||||||
if self.driver and player_name == self.driver then
|
if self.driver and player_name == self.driver then
|
||||||
self.driver = nil
|
|
||||||
carts:manage_attachment(clicker, nil)
|
carts:manage_attachment(clicker, nil)
|
||||||
elseif not self.driver then
|
elseif not self.driver then
|
||||||
self.driver = player_name
|
|
||||||
carts:manage_attachment(clicker, self.object)
|
carts:manage_attachment(clicker, self.object)
|
||||||
|
self.driver = player_name
|
||||||
-- player_api does not update the animation
|
|
||||||
-- when the player is attached, reset to default animation
|
|
||||||
player_api.set_animation(clicker, "stand")
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -73,8 +68,9 @@ end
|
||||||
-- 0.5.x and later: When the driver leaves
|
-- 0.5.x and later: When the driver leaves
|
||||||
function cart_entity:on_detach_child(child)
|
function cart_entity:on_detach_child(child)
|
||||||
if child and child:get_player_name() == self.driver then
|
if child and child:get_player_name() == self.driver then
|
||||||
self.driver = nil
|
-- Clean up eye height
|
||||||
carts:manage_attachment(child, nil)
|
carts:manage_attachment(child, nil)
|
||||||
|
self.driver = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ function carts:manage_attachment(player, obj)
|
||||||
end
|
end
|
||||||
local status = obj ~= nil
|
local status = obj ~= nil
|
||||||
local player_name = player:get_player_name()
|
local player_name = player:get_player_name()
|
||||||
if player_api.player_attached[player_name] == status then
|
if obj and player:get_attach() == obj then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
player_api.player_attached[player_name] = status
|
player_api.player_attached[player_name] = status
|
||||||
|
@ -20,6 +20,10 @@ function carts:manage_attachment(player, obj)
|
||||||
if status then
|
if status then
|
||||||
player:set_attach(obj, "", {x=0, y=-4.5, z=0}, {x=0, y=0, z=0})
|
player:set_attach(obj, "", {x=0, y=-4.5, z=0}, {x=0, y=0, z=0})
|
||||||
player:set_eye_offset({x=0, y=-4, z=0},{x=0, y=-4, z=0})
|
player:set_eye_offset({x=0, y=-4, z=0},{x=0, y=-4, z=0})
|
||||||
|
|
||||||
|
-- player_api does not update the animation
|
||||||
|
-- when the player is attached, reset to default animation
|
||||||
|
player_api.set_animation(player, "stand")
|
||||||
else
|
else
|
||||||
player:set_detach()
|
player:set_detach()
|
||||||
player:set_eye_offset({x=0, y=0, z=0},{x=0, y=0, z=0})
|
player:set_eye_offset({x=0, y=0, z=0},{x=0, y=0, z=0})
|
||||||
|
|
|
@ -853,6 +853,7 @@ minetest.register_tool("doors:key", {
|
||||||
|
|
||||||
-- flip protected to normal
|
-- flip protected to normal
|
||||||
if player_name == prot then
|
if player_name == prot then
|
||||||
|
infotext = " "
|
||||||
owner = ""
|
owner = ""
|
||||||
prot = ""
|
prot = ""
|
||||||
ok = 1
|
ok = 1
|
||||||
|
@ -865,13 +866,13 @@ minetest.register_tool("doors:key", {
|
||||||
meta:set_string("doors_owner", owner)
|
meta:set_string("doors_owner", owner)
|
||||||
meta:set_string("doors_protected", prot)
|
meta:set_string("doors_protected", prot)
|
||||||
|
|
||||||
if not minetest.setting_getbool("creative_mode") then
|
if not minetest.settings:get_bool("creative_mode") then
|
||||||
itemstack:add_wear(65535 / 50)
|
itemstack:add_wear(65535 / 50)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return itemstack
|
return itemstack
|
||||||
end,
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
|
|
@ -42,15 +42,26 @@ minetest.register_node("farming:soy_sauce", {
|
||||||
sounds = default.node_sound_glass_defaults()
|
sounds = default.node_sound_glass_defaults()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- river water availability check
|
||||||
|
local bucket_water
|
||||||
|
|
||||||
|
if minetest.get_mapgen_setting("mgname") == "valleys"
|
||||||
|
or minetest.get_modpath("ethereal") then
|
||||||
|
bucket_water = "bucket:bucket_river_water"
|
||||||
|
else
|
||||||
|
bucket_water = "bucket:bucket_water"
|
||||||
|
end
|
||||||
|
|
||||||
|
-- soy sauce recipe
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
output = "farming:soy_sauce",
|
output = "farming:soy_sauce",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"group:food_soy", "group:food_salt", "group:food_soy"},
|
{"group:food_soy", "group:food_salt", "group:food_soy"},
|
||||||
{"", "group:food_juicer", ""},
|
{"", "group:food_juicer", ""},
|
||||||
{"", "bucket:bucket_river_water", "vessels:glass_bottle"}
|
{"", bucket_water, "vessels:glass_bottle"}
|
||||||
},
|
},
|
||||||
replacements = {
|
replacements = {
|
||||||
{"bucket:bucket_river_water", "bucket:bucket_empty"},
|
{bucket_water, "bucket:bucket_empty"},
|
||||||
{"group:food_juicer", "farming:juicer"}
|
{"group:food_juicer", "farming:juicer"}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -8,7 +8,7 @@ local use_cmi = minetest.global_exists("cmi")
|
||||||
|
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20210515",
|
version = "20210527",
|
||||||
intllib = S,
|
intllib = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {}
|
invis = minetest.global_exists("invisibility") and invisibility or {}
|
||||||
}
|
}
|
||||||
|
@ -2917,14 +2917,9 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir, damage)
|
||||||
-- only play hit sound and show blood effects if damage is 1 or over
|
-- only play hit sound and show blood effects if damage is 1 or over
|
||||||
if damage >= 1 then
|
if damage >= 1 then
|
||||||
|
|
||||||
local snd
|
-- select tool use sound if found, or fallback to default
|
||||||
|
local snd = weapon_def.sound and weapon_def.sound.use
|
||||||
-- weapon sounds
|
or "default_punch"
|
||||||
if weapon_def.sounds then
|
|
||||||
snd = weapon_def.sounds[random(#weapon_def.sounds)]
|
|
||||||
else
|
|
||||||
snd = "default_punch"
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.sound_play(snd, {object = self.object, max_hear_distance = 8}, true)
|
minetest.sound_play(snd, {object = self.object, max_hear_distance = 8}, true)
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,8 @@ local S = signs_lib.gettext
|
||||||
|
|
||||||
local function get_sign_formspec() end
|
local function get_sign_formspec() end
|
||||||
|
|
||||||
|
signs_lib.glow_item = "basic_materials:energy_crystal_simple"
|
||||||
|
|
||||||
signs_lib.lbm_restore_nodes = {}
|
signs_lib.lbm_restore_nodes = {}
|
||||||
signs_lib.old_fenceposts = {}
|
signs_lib.old_fenceposts = {}
|
||||||
signs_lib.old_fenceposts_replacement_signs = {}
|
signs_lib.old_fenceposts_replacement_signs = {}
|
||||||
|
@ -180,7 +182,7 @@ function signs_lib.delete_objects(pos)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function signs_lib.spawn_entity(pos, texture)
|
function signs_lib.spawn_entity(pos, texture, glow)
|
||||||
local node = minetest.get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
local def = minetest.registered_items[node.name]
|
local def = minetest.registered_items[node.name]
|
||||||
if not def or not def.entity_info then return end
|
if not def or not def.entity_info then return end
|
||||||
|
@ -229,6 +231,10 @@ function signs_lib.spawn_entity(pos, texture)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if glow ~= "" then
|
||||||
|
obj:set_properties( {glow = tonumber(glow * 5)} )
|
||||||
|
end
|
||||||
|
|
||||||
if yaw then
|
if yaw then
|
||||||
obj:set_rotation({x = pitch, y = yaw, z=0})
|
obj:set_rotation({x = pitch, y = yaw, z=0})
|
||||||
|
|
||||||
|
@ -247,14 +253,15 @@ function signs_lib.spawn_entity(pos, texture)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function signs_lib.set_obj_text(pos, text)
|
function signs_lib.set_obj_text(pos, text, glow)
|
||||||
local split = signs_lib.split_lines_and_words
|
local split = signs_lib.split_lines_and_words
|
||||||
local text_ansi = Utf8ToAnsi(text)
|
local text_ansi = Utf8ToAnsi(text)
|
||||||
local n = minetest.registered_nodes[minetest.get_node(pos).name]
|
local n = minetest.registered_nodes[minetest.get_node(pos).name]
|
||||||
signs_lib.delete_objects(pos)
|
signs_lib.delete_objects(pos)
|
||||||
-- only create sign entity for actual text
|
-- only create sign entity for actual text
|
||||||
if text_ansi and text_ansi ~= "" then
|
if text_ansi and text_ansi ~= "" then
|
||||||
signs_lib.spawn_entity(pos, signs_lib.make_sign_texture(split(text_ansi), pos) )
|
signs_lib.spawn_entity(pos,
|
||||||
|
signs_lib.make_sign_texture(split(text_ansi), pos), glow)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -707,6 +714,12 @@ function signs_lib.rightclick_sign(pos, node, player, itemstack, pointed_thing)
|
||||||
end
|
end
|
||||||
|
|
||||||
function signs_lib.destruct_sign(pos)
|
function signs_lib.destruct_sign(pos)
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
local glow = meta:get_string("glow")
|
||||||
|
if glow ~= "" and not minetest.is_creative_enabled("") then
|
||||||
|
local num = tonumber(glow)
|
||||||
|
minetest.add_item(pos, ItemStack(signs_lib.glow_item .. " " .. num))
|
||||||
|
end
|
||||||
signs_lib.delete_objects(pos)
|
signs_lib.delete_objects(pos)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -720,6 +733,30 @@ local function make_infotext(text)
|
||||||
return table.concat(lines2, "\n")
|
return table.concat(lines2, "\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function signs_lib.glow(pos, node, puncher)
|
||||||
|
local name = puncher:get_player_name()
|
||||||
|
if minetest.is_protected(pos, name) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local tool = puncher:get_wielded_item()
|
||||||
|
if tool:get_name() == signs_lib.glow_item then
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
local glow = tonumber(meta:get_string("glow"))
|
||||||
|
if not glow then
|
||||||
|
glow = 1
|
||||||
|
elseif glow < 3 then
|
||||||
|
glow = glow + 1
|
||||||
|
else
|
||||||
|
return -- already at brightest level
|
||||||
|
end
|
||||||
|
if not minetest.is_creative_enabled(name) then
|
||||||
|
tool:take_item()
|
||||||
|
puncher:set_wielded_item(tool)
|
||||||
|
end
|
||||||
|
meta:set_string("glow", glow)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function signs_lib.update_sign(pos, fields)
|
function signs_lib.update_sign(pos, fields)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
|
|
||||||
|
@ -737,7 +774,9 @@ function signs_lib.update_sign(pos, fields)
|
||||||
|
|
||||||
meta:set_string("text", text)
|
meta:set_string("text", text)
|
||||||
meta:set_string("infotext", ownstr..make_infotext(text).." ")
|
meta:set_string("infotext", ownstr..make_infotext(text).." ")
|
||||||
signs_lib.set_obj_text(pos, text)
|
|
||||||
|
local glow = meta:get_string("glow")
|
||||||
|
signs_lib.set_obj_text(pos, text, glow)
|
||||||
end
|
end
|
||||||
|
|
||||||
function signs_lib.can_modify(pos, player)
|
function signs_lib.can_modify(pos, player)
|
||||||
|
@ -902,6 +941,23 @@ function signs_lib.register_fence_with_sign()
|
||||||
minetest.log("warning", "[signs_lib] ".."Attempt to call no longer used function signs_lib.register_fence_with_sign()")
|
minetest.log("warning", "[signs_lib] ".."Attempt to call no longer used function signs_lib.register_fence_with_sign()")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local use_glow = function(pos, node, puncher, pointed_thing)
|
||||||
|
if puncher then -- if e.g. a machine tries to punch; only a real person should change the lighting
|
||||||
|
signs_lib.glow(pos, node, puncher)
|
||||||
|
end
|
||||||
|
return signs_lib.update_sign(pos)
|
||||||
|
end
|
||||||
|
|
||||||
|
local glow_drops = function(pos, oldnode, oldmetadata, digger)
|
||||||
|
if minetest.is_creative_enabled(digger:get_player_name()) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local glow = oldmetadata and oldmetadata.fields and oldmetadata.fields.glow
|
||||||
|
if glow then
|
||||||
|
minetest.add_item(pos, ItemStack(signs_lib.glow_item .. " " .. glow))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function signs_lib.register_sign(name, raw_def)
|
function signs_lib.register_sign(name, raw_def)
|
||||||
local def = table.copy(raw_def)
|
local def = table.copy(raw_def)
|
||||||
|
|
||||||
|
@ -917,9 +973,16 @@ function signs_lib.register_sign(name, raw_def)
|
||||||
def.after_place_node = raw_def.after_place_node or signs_lib.after_place_node
|
def.after_place_node = raw_def.after_place_node or signs_lib.after_place_node
|
||||||
|
|
||||||
if raw_def.entity_info then
|
if raw_def.entity_info then
|
||||||
|
|
||||||
|
if def.allow_glow ~= false then
|
||||||
|
def.on_punch = raw_def.on_punch or use_glow
|
||||||
|
def.after_dig_node = raw_def.after_dig_node or glow_drops
|
||||||
|
else
|
||||||
|
def.on_punch = raw_def.on_punch or signs_lib.update_sign
|
||||||
|
end
|
||||||
|
|
||||||
def.on_rightclick = raw_def.on_rightclick or signs_lib.rightclick_sign
|
def.on_rightclick = raw_def.on_rightclick or signs_lib.rightclick_sign
|
||||||
def.on_destruct = raw_def.on_destruct or signs_lib.destruct_sign
|
def.on_destruct = raw_def.on_destruct or signs_lib.destruct_sign
|
||||||
def.on_punch = raw_def.on_punch or signs_lib.update_sign
|
|
||||||
def.number_of_lines = raw_def.number_of_lines or signs_lib.standard_lines
|
def.number_of_lines = raw_def.number_of_lines or signs_lib.standard_lines
|
||||||
def.horiz_scaling = raw_def.horiz_scaling or signs_lib.standard_hscale
|
def.horiz_scaling = raw_def.horiz_scaling or signs_lib.standard_hscale
|
||||||
def.vert_scaling = raw_def.vert_scaling or signs_lib.standard_vscale
|
def.vert_scaling = raw_def.vert_scaling or signs_lib.standard_vscale
|
||||||
|
|
3
mods/skinsdb/meta/character_2034.txt
Normal file
3
mods/skinsdb/meta/character_2034.txt
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Petra Ral
|
||||||
|
ne4eburek
|
||||||
|
CC BY-SA 3.0
|
3
mods/skinsdb/meta/character_2035.txt
Normal file
3
mods/skinsdb/meta/character_2035.txt
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
character_CTF_blue_knight
|
||||||
|
Sam_0
|
||||||
|
CC BY 3.0
|
3
mods/skinsdb/meta/character_2036.txt
Normal file
3
mods/skinsdb/meta/character_2036.txt
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
character_CTF_red_knight
|
||||||
|
Sam_0
|
||||||
|
CC BY 4.0
|
3
mods/skinsdb/meta/character_2037.txt
Normal file
3
mods/skinsdb/meta/character_2037.txt
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
character_CTF_red_medic
|
||||||
|
Sam_0
|
||||||
|
CC BY 4.0
|
BIN
mods/skinsdb/textures/character_2034.png
Normal file
BIN
mods/skinsdb/textures/character_2034.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
BIN
mods/skinsdb/textures/character_2035.png
Normal file
BIN
mods/skinsdb/textures/character_2035.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
mods/skinsdb/textures/character_2036.png
Normal file
BIN
mods/skinsdb/textures/character_2036.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
mods/skinsdb/textures/character_2037.png
Normal file
BIN
mods/skinsdb/textures/character_2037.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
|
@ -21,7 +21,7 @@ HighPerf Pusher=HighPerf Schieber
|
||||||
|
|
||||||
### pushing_chest.lua ###
|
### pushing_chest.lua ###
|
||||||
|
|
||||||
HighPerf Pushing Chest=HighPerf Shiebende Kiste
|
HighPerf Pushing Chest=HighPerf Schiebende Kiste
|
||||||
|
|
||||||
### teleporter.lua ###
|
### teleporter.lua ###
|
||||||
|
|
||||||
|
|
|
@ -88,5 +88,6 @@ Textures: CC0
|
||||||
- 2020-02-02 v1.8 * 'special nodes' as alternative to 'secondary nodes' introduced
|
- 2020-02-02 v1.8 * 'special nodes' as alternative to 'secondary nodes' introduced
|
||||||
- 2020-05-31 v1.9 * Generator function 'get_tube_line' added, storage improvements
|
- 2020-05-31 v1.9 * Generator function 'get_tube_line' added, storage improvements
|
||||||
- 2021-01-23 v2.0 * Add functions for easy & fast 'valid side' checking (PR #8)
|
- 2021-01-23 v2.0 * Add functions for easy & fast 'valid side' checking (PR #8)
|
||||||
|
- 2021-05-24 v2.1 * Add API functions 'register_on_tube_update2'
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -102,8 +102,12 @@ function Tube:update_secondary_node(pos1, dir1, pos2, dir2)
|
||||||
local node,_ = self:get_secondary_node(pos1)
|
local node,_ = self:get_secondary_node(pos1)
|
||||||
if node then
|
if node then
|
||||||
local ndef = minetest.registered_nodes[node.name] or {}
|
local ndef = minetest.registered_nodes[node.name] or {}
|
||||||
|
-- New functions
|
||||||
if ndef.tubelib2_on_update2 then
|
if ndef.tubelib2_on_update2 then
|
||||||
ndef.tubelib2_on_update2(pos1, dir1, self, node)
|
ndef.tubelib2_on_update2(pos1, dir1, self, node)
|
||||||
|
elseif self.clbk_update_secondary_node2 then
|
||||||
|
self.clbk_update_secondary_node2(pos1, dir1, self, node)
|
||||||
|
-- Legacy functions
|
||||||
elseif ndef.tubelib2_on_update then
|
elseif ndef.tubelib2_on_update then
|
||||||
ndef.tubelib2_on_update(node, pos1, dir1, pos2, Turn180Deg[dir2])
|
ndef.tubelib2_on_update(node, pos1, dir1, pos2, Turn180Deg[dir2])
|
||||||
elseif self.clbk_update_secondary_node then
|
elseif self.clbk_update_secondary_node then
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
]]--
|
]]--
|
||||||
|
|
||||||
-- Version for compatibility checks, see readme.md/history
|
-- Version for compatibility checks, see readme.md/history
|
||||||
tubelib2.version = 2.0
|
tubelib2.version = 2.1
|
||||||
|
|
||||||
-- for lazy programmers
|
-- for lazy programmers
|
||||||
local S = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
local S = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||||
|
@ -320,6 +320,12 @@ function Tube:register_on_tube_update(update_secondary_node)
|
||||||
self.clbk_update_secondary_node = update_secondary_node
|
self.clbk_update_secondary_node = update_secondary_node
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Called for each connected node when the tube connection has been changed.
|
||||||
|
-- func(pos1, out_dir, self, node)
|
||||||
|
function Tube:register_on_tube_update2(update_secondary_node2)
|
||||||
|
self.clbk_update_secondary_node2 = update_secondary_node2
|
||||||
|
end
|
||||||
|
|
||||||
function Tube:get_pos(pos, dir)
|
function Tube:get_pos(pos, dir)
|
||||||
return vector.add(pos, Dir6dToVector[dir or 0])
|
return vector.add(pos, Dir6dToVector[dir or 0])
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue