This commit is contained in:
root 2021-03-25 16:46:51 +01:00
parent dd70d1a26a
commit 110db201f7
101 changed files with 306 additions and 94 deletions

View file

@ -638,17 +638,19 @@ end
armor.get_valid_player = function(self, player, msg) armor.get_valid_player = function(self, player, msg)
msg = msg or "" msg = msg or ""
if not player then if not player then
minetest.log("warning", S("3d_armor: Player reference is nil @1", msg)) minetest.log("warning", ("3d_armor%s: Player reference is nil"):format(msg))
return return
end end
local name = player:get_player_name() local name = player:get_player_name()
if not name then if not name then
minetest.log("warning", S("3d_armor: Player name is nil @1", msg)) minetest.log("warning", ("3d_armor%s: Player name is nil"):format(msg))
return return
end end
local inv = minetest.get_inventory({type="detached", name=name.."_armor"}) local inv = minetest.get_inventory({type="detached", name=name.."_armor"})
if not inv then if not inv then
minetest.log("warning", S("3d_armor: Detached armor inventory is nil @1", msg)) -- This check may fail when called inside `on_joinplayer`
-- in that case, the armor will be initialized/updated later on
minetest.log("warning", ("3d_armor%s: Detached armor inventory is nil"):format(msg))
return return
end end
return name, inv return name, inv

View file

@ -331,6 +331,7 @@ minetest.register_on_joinplayer(function(player)
local player_name = player:get_player_name() local player_name = player:get_player_name()
minetest.after(0, function() minetest.after(0, function()
-- TODO: Added in 7566ecc - What's the prupose?
local pplayer = minetest.get_player_by_name(player_name) local pplayer = minetest.get_player_by_name(player_name)
if pplayer and init_player_armor(pplayer) == false then if pplayer and init_player_armor(pplayer) == false then
pending_players[pplayer] = 0 pending_players[pplayer] = 0

View file

@ -174,12 +174,16 @@ function atc.get_atc_controller_formspec(pos, meta)
local formspec="size[8,6]" local formspec="size[8,6]"
-- "dropdown[0,0;3;mode;static,mesecon,digiline;"..mode.."]" -- "dropdown[0,0;3;mode;static,mesecon,digiline;"..mode.."]"
if mode<3 then if mode<3 then
formspec=formspec.."field[0.5,1.5;7,1;command;"..attrans("Command")..";"..minetest.formspec_escape(command).."]" formspec=formspec
.."style[command;font=mono]"
.."field[0.8,1.5;7,1;command;"..attrans("Command")..";"..minetest.formspec_escape(command).."]"
if tonumber(mode)==2 then if tonumber(mode)==2 then
formspec=formspec.."field[0.5,3;7,1;command_on;"..attrans("Command (on)")..";"..minetest.formspec_escape(command_on).."]" formspec=formspec
.."style[command_on;font=mono]"
.."field[0.8,3;7,1;command_on;"..attrans("Command (on)")..";"..minetest.formspec_escape(command_on).."]"
end end
else else
formspec=formspec.."field[0.5,1.5;7,1;channel;"..attrans("Digiline channel")..";"..minetest.formspec_escape(channel).."]" formspec=formspec.."field[0.8,1.5;7,1;channel;"..attrans("Digiline channel")..";"..minetest.formspec_escape(channel).."]"
end end
return formspec.."button_exit[0.5,4.5;7,1;save;"..attrans("Save").."]" return formspec.."button_exit[0.5,4.5;7,1;save;"..attrans("Save").."]"
end end

View file

@ -73,8 +73,10 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
rules=advtrains.meseconrules, rules=advtrains.meseconrules,
["action_"..f.as] = function (pos, node) ["action_"..f.as] = function (pos, node)
advtrains.ndb.swap_node(pos, {name = "advtrains:retrosignal_"..f.as..rotation, param2 = node.param2}, true) advtrains.ndb.swap_node(pos, {name = "advtrains:retrosignal_"..f.as..rotation, param2 = node.param2}, true)
if advtrains.interlocking then
advtrains.interlocking.signal_on_aspect_changed(pos) advtrains.interlocking.signal_on_aspect_changed(pos)
end end
end
}}, }},
on_rightclick=function(pos, node, player) on_rightclick=function(pos, node, player)
local pname = player:get_player_name() local pname = player:get_player_name()
@ -85,8 +87,10 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
advtrains.interlocking.show_ip_form(pos, pname) advtrains.interlocking.show_ip_form(pos, pname)
elseif advtrains.check_turnout_signal_protection(pos, player:get_player_name()) then elseif advtrains.check_turnout_signal_protection(pos, player:get_player_name()) then
advtrains.ndb.swap_node(pos, {name = "advtrains:retrosignal_"..f.as..rotation, param2 = node.param2}, true) advtrains.ndb.swap_node(pos, {name = "advtrains:retrosignal_"..f.as..rotation, param2 = node.param2}, true)
if advtrains.interlocking then
advtrains.interlocking.signal_on_aspect_changed(pos) advtrains.interlocking.signal_on_aspect_changed(pos)
end end
end
end, end,
-- new signal API -- new signal API
advtrains = { advtrains = {
@ -134,8 +138,10 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
rules=advtrains.meseconrules, rules=advtrains.meseconrules,
["action_"..f.as] = function (pos, node) ["action_"..f.as] = function (pos, node)
advtrains.setstate(pos, f.als, node) advtrains.setstate(pos, f.als, node)
if advtrains.interlocking then
advtrains.interlocking.signal_on_aspect_changed(pos) advtrains.interlocking.signal_on_aspect_changed(pos)
end end
end
}}, }},
on_rightclick=function(pos, node, player) on_rightclick=function(pos, node, player)
local pname = player:get_player_name() local pname = player:get_player_name()
@ -146,8 +152,10 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
advtrains.interlocking.show_ip_form(pos, pname) advtrains.interlocking.show_ip_form(pos, pname)
elseif advtrains.check_turnout_signal_protection(pos, player:get_player_name()) then elseif advtrains.check_turnout_signal_protection(pos, player:get_player_name()) then
advtrains.setstate(pos, f.als, node) advtrains.setstate(pos, f.als, node)
if advtrains.interlocking then
advtrains.interlocking.signal_on_aspect_changed(pos) advtrains.interlocking.signal_on_aspect_changed(pos)
end end
end
end, end,
-- new signal API -- new signal API
advtrains = { advtrains = {
@ -206,6 +214,9 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
rules = mrules_wallsignal, rules = mrules_wallsignal,
["action_"..f.as] = function (pos, node) ["action_"..f.as] = function (pos, node)
advtrains.setstate(pos, f.als, node) advtrains.setstate(pos, f.als, node)
if advtrains.interlocking then
advtrains.interlocking.signal_on_aspect_changed(pos)
end
end end
}}, }},
on_rightclick=function(pos, node, player) on_rightclick=function(pos, node, player)
@ -217,6 +228,9 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
advtrains.interlocking.show_ip_form(pos, pname) advtrains.interlocking.show_ip_form(pos, pname)
elseif advtrains.check_turnout_signal_protection(pos, player:get_player_name()) then elseif advtrains.check_turnout_signal_protection(pos, player:get_player_name()) then
advtrains.setstate(pos, f.als, node) advtrains.setstate(pos, f.als, node)
if advtrains.interlocking then
advtrains.interlocking.signal_on_aspect_changed(pos)
end
end end
end, end,
-- new signal API -- new signal API

View file

@ -25,8 +25,8 @@ function atil.show_route_edit_form(pname, sigd, routeid)
if not route then return end if not route then return end
local form = "size[9,10]label[0.5,0.2;Route overview]" local form = "size[9,10]label[0.5,0.2;Route overview]"
form = form.."field[0.8,1.2;5.2,1;name;Route name;"..minetest.formspec_escape(route.name).."]" form = form.."field[0.8,1.2;6.5,1;name;Route name;"..minetest.formspec_escape(route.name).."]"
form = form.."button[5.5,0.9;1,1;setname;Set]" form = form.."button[7.0,0.9;1.5,1;setname;Set]"
-- construct textlist for route information -- construct textlist for route information
local tab = {} local tab = {}
@ -80,15 +80,16 @@ function atil.show_route_edit_form(pname, sigd, routeid)
itab("Route ends on dead-end") itab("Route ends on dead-end")
end end
form = form.."textlist[0.5,2;7,4;rtelog;"..table.concat(tab, ",").."]" form = form.."textlist[0.5,2;7.75,3.9;rtelog;"..table.concat(tab, ",").."]"
form = form.."button[0.5,6;2,1;back;<<< Back to signal]" form = form.."button[0.5,6;3,1;back;<<< Back to signal]"
form = form.."button[3.5,6;2,1;aspect;Signal Aspect]" form = form.."button[4.5,6;2,1;aspect;Signal Aspect]"
form = form.."button[5.5,6;2,1;delete;Delete Route]" form = form.."button[6.5,6;2,1;delete;Delete Route]"
--atdebug(route.ars) --atdebug(route.ars)
form = form.."textarea[1,7.3;5.2,3;ars;ARS Rule List;"..atil.ars_to_text(route.ars).."]" form = form.."style[ars;font=mono]"
form = form.."button[6,7.7;1,1;savears;Save]" form = form.."textarea[0.8,7.3;5,3;ars;ARS Rule List;"..atil.ars_to_text(route.ars).."]"
form = form.."button[5.5,7.23;3,1;savears;Save ARS List]"
minetest.show_formspec(pname, "at_il_routeedit_"..minetest.pos_to_string(sigd.p).."_"..sigd.s.."_"..routeid, form) minetest.show_formspec(pname, "at_il_routeedit_"..minetest.pos_to_string(sigd.p).."_"..sigd.s.."_"..routeid, form)

View file

@ -50,19 +50,18 @@ local function show_stoprailform(pos, player)
end end
local form = "size[8,7]" local form = "size[8,7]"
form = form.."field[0.5,0.5;7,1;stn;"..attrans("Station Code")..";"..minetest.formspec_escape(stdata.stn).."]" form = form.."style[stn,ars;font=mono]"
form = form.."field[0.5,1.5;7,1;stnname;"..attrans("Station Name")..";"..minetest.formspec_escape(stnname).."]" form = form.."field[0.8,0.8;2,1;stn;"..attrans("Station Code")..";"..minetest.formspec_escape(stdata.stn).."]"
form = form.."field[0.5,2.5;1.5,1;ddelay;"..attrans("Door Delay")..";"..minetest.formspec_escape(stdata.ddelay).."]" form = form.."field[2.8,0.8;5,1;stnname;"..attrans("Station Name")..";"..minetest.formspec_escape(stnname).."]"
form = form.."field[2,2.5;2,1;speed;"..attrans("Departure Speed")..";"..minetest.formspec_escape(stdata.speed).."]" form = form.."field[0.80,2.0;1.75,1;ddelay;"..attrans("Door Delay")..";"..minetest.formspec_escape(stdata.ddelay).."]"
form = form.."checkbox[5,1.75;reverse;"..attrans("Reverse train")..";"..(stdata.reverse and "true" or "false").."]" form = form.."field[2.55,2.0;1.75,1;speed;"..attrans("Dep. Speed")..";"..minetest.formspec_escape(stdata.speed).."]"
form = form.."checkbox[5,2.0;kick;"..attrans("Kick out passengers")..";"..(stdata.kick and "true" or "false").."]" form = form.."field[4.30,2.0;1.75,1;track;"..attrans("Track")..";"..minetest.formspec_escape(stdata.track).."]"
form = form.."label[0.5,3;Door side:]" form = form.."field[6.05,2.0;1.75,1;wait;"..attrans("Stop Time")..";"..stdata.wait.."]"
form = form.."dropdown[0.5,3;2;doors;Left,Right,Closed;"..door_dropdown[stdata.doors].."]" form = form.."label[0.5,2.6;"..attrans("Door Side").."]"
form = form.."field[5,3.5;2,1;track;"..attrans("Track")..";"..minetest.formspec_escape(stdata.track).."]" form = form.."dropdown[0.51,3.0;2;doors;Left,Right,Closed;"..door_dropdown[stdata.doors].."]"
form = form.."field[5,4.5;2,1;wait;"..attrans("Stop Time")..";"..stdata.wait.."]" form = form.."checkbox[3.00,2.7;reverse;"..attrans("Reverse train")..";"..(stdata.reverse and "true" or "false").."]"
form = form.."checkbox[3.00,3.1;kick;"..attrans("Kick out passengers")..";"..(stdata.kick and "true" or "false").."]"
form = form.."textarea[0.5,4;4,2;ars;Trains stopping here (ARS rules);"..advtrains.interlocking.ars_to_text(stdata.ars).."]" form = form.."textarea[0.8,4.2;7,2;ars;Trains stopping here (ARS rules);"..advtrains.interlocking.ars_to_text(stdata.ars).."]"
form = form.."button[0.5,6;7,1;save;"..attrans("Save").."]" form = form.."button[0.5,6;7,1;save;"..attrans("Save").."]"
minetest.show_formspec(pname, "at_lines_stop_"..pe, form) minetest.show_formspec(pname, "at_lines_stop_"..pe, form)
@ -89,24 +88,21 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
tmp_checkboxes[pe].reverse = (fields.reverse == "true") tmp_checkboxes[pe].reverse = (fields.reverse == "true")
end end
if fields.save then if fields.save then
if fields.stn and stdata.stn ~= fields.stn then if fields.stn and stdata.stn ~= fields.stn and fields.stn ~= "" then
if fields.stn ~= "" then
local stn = advtrains.lines.stations[fields.stn] local stn = advtrains.lines.stations[fields.stn]
if stn then if stn then
if (stn.owner == pname or minetest.check_player_privs(pname, "train_admin")) then if (stn.owner == pname or minetest.check_player_privs(pname, "train_admin")) then
stdata.stn = fields.stn stdata.stn = fields.stn
else else
minetest.chat_send_player(pname, "Station code '"..fields.stn.."' does already exist and is owned by "..stn.owner) minetest.chat_send_player(pname, "Station code '"..fields.stn.."' does already exist and is owned by "..stn.owner)
show_stoprailform(pos,player)
return
end end
else else
advtrains.lines.stations[fields.stn] = {name = fields.stnname, owner = pname} advtrains.lines.stations[fields.stn] = {name = fields.stnname, owner = pname}
stdata.stn = fields.stn stdata.stn = fields.stn
end end
end end
updatemeta(pos)
show_stoprailform(pos, player)
return
end
local stn = advtrains.lines.stations[stdata.stn] local stn = advtrains.lines.stations[stdata.stn]
if stn and fields.stnname and fields.stnname ~= stn.name then if stn and fields.stnname and fields.stnname ~= stn.name then
if (stn.owner == pname or minetest.check_player_privs(pname, "train_admin")) then if (stn.owner == pname or minetest.check_player_privs(pname, "train_admin")) then

View file

@ -41,9 +41,14 @@ function ac.getform(pos, meta_p)
sel=#envs_asvalues sel=#envs_asvalues
end end
end end
local form = "size[10,10]dropdown[0,0;3;env;"..table.concat(envs_asvalues, ",")..";"..sel.."]" local form = "size["..atlatc.CODE_FORM_SIZE.."]"
.."button[4,0;2,1;save;Save]button[7,0;2,1;cle;Clear local env] textarea[0.2,1;10,10;code;Code;"..minetest.formspec_escape(code).."]" .."style[code;font=mono]"
.."label[0,9.8;"..err.."]" .."label[0,-0.1;Environment]"
.."dropdown[0,0.3;3;env;"..table.concat(envs_asvalues, ",")..";"..sel.."]"
.."button[5,0.2;2,1;save;Save]"
.."button[7,0.2;3,1;cle;Clear Local Env.]"
.."textarea[0.3,1.5;"..atlatc.CODE_FORM_SIZE..";code;Code;"..minetest.formspec_escape(code).."]"
.."label[0,9.7;"..err.."]"
return form return form
end end

View file

@ -1,27 +1,18 @@
--chatcmds.lua --chatcmds.lua
--Registers commands to modify the init and step code for LuaAutomation --Registers commands to modify the init and step code for LuaAutomation
--position helper.
--punching a node will result in that position being saved and inserted into a text field on the top of init form.
local punchpos={}
minetest.register_on_punchnode(function(pos, node, player, pointed_thing)
local pname=player:get_player_name()
punchpos[pname]=pos
end)
local function get_init_form(env, pname) local function get_init_form(env, pname)
local err = env.init_err or "" local err = env.init_err or ""
local code = env.init_code or "" local code = env.init_code or ""
local ppos=punchpos[pname]
local pp="" local form = "size["..atlatc.CODE_FORM_SIZE.."]"
if ppos then .."style[code;font=mono]"
pp="POS"..minetest.pos_to_string(ppos) .."button[0.0,0.2;2.5,1;run;Run Init Code]"
end .."button[2.5,0.2;2.5,1;cls;Clear S]"
local form = "size[10,10]button[0,0;2,1;run;Run InitCode]button[2,0;2,1;cls;Clear S]" .."button[5.0,0.2;2.5,1;save;Save]"
.."button[4,0;2,1;save;Save] button[6,0;2,1;del;Delete Env.] field[8.1,0.5;2,1;punchpos;Last punched position;"..pp.."]" .."button[7.5,0.2;2.5,1;del;Delete Env.]"
.."textarea[0.2,1;10,10;code;Environment initialization code;"..minetest.formspec_escape(code).."]" .."textarea[0.3,1.5;"..atlatc.CODE_FORM_SIZE..";code;Environment initialization code;"..minetest.formspec_escape(code).."]"
.."label[0,9.8;"..err.."]" .."label[0.0,9.7;"..err.."]"
return form return form
end end

View file

@ -16,6 +16,9 @@ atlatc = { envs = {}}
minetest.register_privilege("atlatc", { description = "Player can place and modify LUA ATC components. Grant with care! Allows to execute bad LUA code.", give_to_singleplayer = false, default= false }) minetest.register_privilege("atlatc", { description = "Player can place and modify LUA ATC components. Grant with care! Allows to execute bad LUA code.", give_to_singleplayer = false, default= false })
--Size of code input forms in X,Y notation. Must be at least 10x10
atlatc.CODE_FORM_SIZE = "15,12"
--assertt helper. error if a variable is not of a type --assertt helper. error if a variable is not of a type
function assertt(var, typ) function assertt(var, typ)
if type(var)~=typ then if type(var)~=typ then

View file

@ -1,8 +1,12 @@
-- Code from the Vehicle Mash mod (WTFPL license) -- Code from the Vehicle Mash mod (WTFPL license)
-- Translation support
local S = minetest.get_translator("cloud_items")
local name = "car_cloud" local name = "car_cloud"
local definition = ... local definition = ...
definition.description = "Cloud car" definition.description = S("Cloud car")
definition.inventory_image = "cloud_items_car_cloud_inventory.png" definition.inventory_image = "cloud_items_car_cloud_inventory.png"
definition.wield_image = "cloud_items_car_cloud_inventory.png" definition.wield_image = "cloud_items_car_cloud_inventory.png"
definition.textures = {"cloud_items_car_cloud.png"} definition.textures = {"cloud_items_car_cloud.png"}

View file

@ -528,6 +528,9 @@ local ship_def = {
terrain_type = 3, terrain_type = 3,
max_speed_forward = 10, max_speed_forward = 10,
max_speed_reverse = 7, max_speed_reverse = 7,
max_speed_upwards = 5,
max_speed_downwards = 3.5,
accel = 4, accel = 4,
braking = 5, braking = 5,
turn_speed = 6, turn_speed = 6,
@ -549,8 +552,8 @@ local ship_def = {
} }
-- Cloud ship (based on the Vehicle Mash boat) -- Cloud ship (based on the Vehicle Mash boat)
local boat_enabled = minetest.settings:get_bool("cloud_items.enable_cloud_car") local ship_enabled = minetest.settings:get_bool("cloud_items.enable_cloud_ship")
if boat_enabled or boat_enabled == nil then if ship_enabled or ship_enabled == nil then
loadfile(minetest.get_modpath(minetest.get_current_modname()) .. "/ship.lua")(table.copy(ship_def)) loadfile(minetest.get_modpath(minetest.get_current_modname()) .. "/ship.lua")(table.copy(ship_def))
end end
@ -596,7 +599,7 @@ local car_def = {
} }
-- Cloud car (similar from the CAR01 from Vehicle Mash) -- Cloud car (similar from the CAR01 from Vehicle Mash)
local car_enabled = minetest.settings:get_bool("cloud_items.enable_cloud_ship") local car_enabled = minetest.settings:get_bool("cloud_items.enable_cloud_car")
if car_enabled or car_enabled == nil then if car_enabled or car_enabled == nil then
loadfile(minetest.get_modpath(minetest.get_current_modname()) .. "/car.lua")(table.copy(car_def)) loadfile(minetest.get_modpath(minetest.get_current_modname()) .. "/car.lua")(table.copy(car_def))
end end

View file

@ -28,7 +28,7 @@ Decorative cloud Slab=Losa de Nube decorativa
Inner decorative cloud Stair=Escalera interior de Nube decorativa Inner decorative cloud Stair=Escalera interior de Nube decorativa
Outer decorative cloud Stair=Escalera exterior de Nube decorativa Outer decorative cloud Stair=Escalera exterior de Nube decorativa
Cloud Microblock=Microbloque de nube Cloud Microblock=Microbloque de nube
Cloud Slope= Cloud Slope=Ladera de nube
Cloud Panel=Panel de nube Cloud Panel=Panel de nube
Cloud Stairs=Escalera de nube Cloud Stairs=Escalera de nube
Decorative cloud Microblock=Microbloque de nube decorativa Decorative cloud Microblock=Microbloque de nube decorativa
@ -37,4 +37,5 @@ Decorative cloud Panel=Barre en nuage decorativa
Decorative cloud Stairs=Escalera de nube decorativa Decorative cloud Stairs=Escalera de nube decorativa
Cloud multitool=Multiherramienta de nube Cloud multitool=Multiherramienta de nube
Cloud car=Carro de nube Cloud car=Carro de nube
Cloud ship=Nave de nube
Cloud Gauntlets=Guanteletes de nube Cloud Gauntlets=Guanteletes de nube

View file

@ -37,4 +37,5 @@ Decorative cloud Panel=
Decorative cloud Stairs= Decorative cloud Stairs=
Cloud multitool= Cloud multitool=
Cloud car= Cloud car=
Cloud ship=
Cloud Gauntlets= Cloud Gauntlets=

View file

@ -1,8 +1,12 @@
-- Code from the Vehicle Mash mod (WTFPL license) -- Code from the Vehicle Mash mod (WTFPL license)
-- Translation support
local S = minetest.get_translator("cloud_items")
local name = "cloud_ship" local name = "cloud_ship"
local definition = ... local definition = ...
definition.description = "Cloud ship" definition.description = S("Cloud ship")
definition.inventory_image = "cloud_items_cloud_ship_inventory.png" definition.inventory_image = "cloud_items_cloud_ship_inventory.png"
definition.wield_image = "cloud_items_cloud_ship_inventory.png" definition.wield_image = "cloud_items_cloud_ship_inventory.png"
definition.mesh = "cloud_items_cloud_ship.obj" definition.mesh = "cloud_items_cloud_ship.obj"

View file

@ -1,9 +1,9 @@
# Library Mount [![Build status](https://github.com/Panquesito7/lib_mount/workflows/build/badge.svg)](https://github.com/Panquesito7/lib_mount/actions) [![License](https://img.shields.io/badge/license-LGPLv2.1%2B-blue.svg)](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html) [![ContentDB](https://content.minetest.net/packages/Panquesito7/lib_mount/shields/downloads/)](https://content.minetest.net/packages/Panquesito7/lib_mount/) # Library Mount [![Build status](https://github.com/minetest-mods/lib_mount/workflows/build/badge.svg)](https://github.com/minetest-mods/lib_mount/actions) [![License](https://img.shields.io/badge/license-LGPLv2.1%2B-blue.svg)](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html) [![ContentDB](https://content.minetest.net/packages/Panquesito7/lib_mount/shields/downloads/)](https://content.minetest.net/packages/Panquesito7/lib_mount/)
Made by [blert2112](https://github.com/blert2112).\ Made by [blert2112](https://github.com/blert2112).\
Handed over to [Panquesito7](https://github.com/Panquesito7). Handed over to [Panquesito7](https://github.com/Panquesito7).
Current version: 1.2 Current version: 1.3
## Dependencies ## Dependencies
@ -29,11 +29,11 @@ See [`LICENSE.md`](LICENSE.md) for information.
## Installation ## Installation
- Unzip the archive, rename the folder to `lib_mount` and place it in ../minetest/mods/ - Unzip the archive, rename the folder to `lib_mount` and place it in `../minetest/mods/`.
- GNU/Linux: If you use a system-wide installation place it in ~/.minetest/mods/. - GNU/Linux: If you use a system-wide installation, place it in `~/.minetest/mods/`.
- If you only want this to be used in a single world, place the folder in worldmods/ in your world directory. - If you only want this to be used in a single world, place the folder in `worldmods/` in your world directory.
For further information or help, see:\ For further information or help, see:\
<http://wiki.minetest.net/Installing_Mods>. <http://wiki.minetest.net/Installing_Mods>.

View file

@ -278,13 +278,13 @@ function lib_mount.drive(entity, dtime, is_mob, moving_anim, stand_anim, jump_he
velo.y = velo.y + (jump_height * 3) + 1 velo.y = velo.y + (jump_height * 3) + 1
acce_y = acce_y + (acce_y * 3) + 1 acce_y = acce_y + (acce_y * 3) + 1
end end
if can_go_down and can_go_up and can_fly and can_fly == true then if can_go_up and can_fly and can_fly == true then
velo.y = velo.y + 1 velo.y = velo.y + 1
acce_y = acce_y + 1 acce_y = acce_y + 1
end end
end end
if ctrl.sneak then if ctrl.sneak then
if can_go_down and can_go_up and can_fly and can_fly == true then if can_go_down and can_fly and can_fly == true then
velo.y = velo.y - 1 velo.y = velo.y - 1
acce_y = acce_y - 1 acce_y = acce_y - 1
end end
@ -317,6 +317,24 @@ function lib_mount.drive(entity, dtime, is_mob, moving_anim, stand_anim, jump_he
return return
end end
-- Stop! (upwards and downwards; applies only if `can_fly` is enabled)
if can_fly == true then
local s2 = get_sign(velo.y)
local s3 = get_sign(acce_y)
velo.y = velo.y - 0.02 * s2
acce_y = acce_y - 0.02 * s3
if s2 ~= get_sign(velo.y) then
entity.object:set_velocity({x=0, y=0, z=0})
velo.y = 0
return
end
if s3 ~= get_sign(acce_y) then
entity.object:set_velocity({x=0, y=0, z=0})
acce_y = 0 -- luacheck: ignore
return
end
end
-- enforce speed limit forward and reverse -- enforce speed limit forward and reverse
local max_spd = entity.max_speed_reverse local max_spd = entity.max_speed_reverse
if get_sign(entity.v) >= 0 then if get_sign(entity.v) >= 0 then
@ -326,6 +344,25 @@ function lib_mount.drive(entity, dtime, is_mob, moving_anim, stand_anim, jump_he
entity.v = entity.v - get_sign(entity.v) entity.v = entity.v - get_sign(entity.v)
end end
-- Enforce speed limit when going upwards or downwards (applies only if `can_fly` is enabled)
if can_fly == true then
local max_spd_flying = entity.max_speed_downwards
if get_sign(velo.y) >= 0 or get_sign(acce_y) >= 0 then
max_spd_flying = entity.max_speed_upwards
end
if math.abs(velo.y) > max_spd_flying then
velo.y = velo.y - get_sign(velo.y)
end
if velo.y > max_spd_flying then -- This check is to prevent exceeding the maximum speed; but the above check also prevents that.
velo.y = velo.y - get_sign(velo.y)
end
if math.abs(acce_y) > max_spd_flying then
acce_y = acce_y - get_sign(acce_y)
end
end
-- Set position, velocity and acceleration -- Set position, velocity and acceleration
local p = entity.object:get_pos() local p = entity.object:get_pos()
local new_velo = {x=0, y=0, z=0} local new_velo = {x=0, y=0, z=0}
@ -337,6 +374,7 @@ function lib_mount.drive(entity, dtime, is_mob, moving_anim, stand_anim, jump_he
if ni == "air" then if ni == "air" then
if can_fly == true then if can_fly == true then
new_acce.y = 0 new_acce.y = 0
acce_y = acce_y - get_sign(acce_y) -- When going down, this will prevent from exceeding the maximum speed.
end end
elseif ni == "liquid" then elseif ni == "liquid" then
if entity.terrain_type == 2 or entity.terrain_type == 3 then if entity.terrain_type == 2 or entity.terrain_type == 3 then

View file

@ -53,8 +53,7 @@ stepheight = 1.1,
stoodup_end = 0, stoodup_end = 0,
}, },
follow = { follow = {
"mobs_animal:rat", "ethereal:fish_raw", "mobs_fish:clownfish", "mobs:rat", "group:food_fish_raw", "mobs_fish:tropical", "xocean:fish_edible"
"mobs_fish:tropical", "xocean:fish_edible"
}, },
view_range = 8, view_range = 8,

View file

@ -46,7 +46,7 @@ stepheight = 0.6,
fly_in = {"default:water_source", "default:water_flowing"}, fly_in = {"default:water_source", "default:water_flowing"},
floats = 0, floats = 0,
follow = { follow = {
"ethereal:fish_raw", "mobs_fish:clownfish", "mobs_fish:tropical", "group:food_fish_raw", "mobs_fish:clownfish", "mobs_fish:tropical",
"mobs_fish:clownfish_set", "mobs_fish:tropical_set", "xocean:fish_edible" "mobs_fish:clownfish_set", "mobs_fish:tropical_set", "xocean:fish_edible"
}, },
view_range = 5, view_range = 5,

View file

@ -8,7 +8,7 @@ local use_cmi = minetest.global_exists("cmi")
mobs = { mobs = {
mod = "redo", mod = "redo",
version = "20210318", version = "20210323",
intllib = S, intllib = S,
invis = minetest.global_exists("invisibility") and invisibility or {} invis = minetest.global_exists("invisibility") and invisibility or {}
} }
@ -251,9 +251,17 @@ local check_for = function(look_for, look_inside)
for _, str in pairs(look_inside) do for _, str in pairs(look_inside) do
if str == look_for then if str == look_for then
return true return true
end end
if str:find("group:") then
local group = str:split(":")[2]
if minetest.get_item_group(look_for, group) ~= 0 then
return true
end
end
end end
end end

View file

@ -76,7 +76,7 @@ functions needed for the mob to work properly which contains the following:
'floats' when set to 1 mob will float in water, 0 has them sink. 'floats' when set to 1 mob will float in water, 0 has them sink.
'follow' mobs follow player when holding any of the items which appear 'follow' mobs follow player when holding any of the items which appear
on this table, the same items can be fed to a mob to tame or on this table, the same items can be fed to a mob to tame or
breed e.g. {"farming:wheat", "default:apple"} breed e.g. {"farming:wheat", "default:apple", "group:fish"}
'reach' is how far the mob can attack player when standing 'reach' is how far the mob can attack player when standing
nearby, default is 3 nodes. nearby, default is 3 nodes.

View file

@ -0,0 +1,3 @@
refi_player
kheftel
CC 0 (1.0)

View file

@ -0,0 +1,3 @@
uvlight_player
Avyukt More
CC BY-SA 4.0

View file

@ -0,0 +1,3 @@
mcl_player
TenPlus
CC BY-SA 4.0

View file

@ -0,0 +1,3 @@
mcl_player_beard
MirceaKitsune
CC BY-SA 4.0

View file

@ -0,0 +1,3 @@
igor
TenPlus1
CC BY-SA 4.0

View file

@ -0,0 +1,3 @@
ogre
TenPlus1
CC BY-SA 4.0

View file

@ -0,0 +1,3 @@
green_monster
TenPlus1
CC BY-SA 4.0

View file

@ -0,0 +1,3 @@
skeleton_disguise
TenPlus1
CC BY-SA 4.0

View file

@ -0,0 +1,3 @@
green_guy
TenPlus1
CC BY-SA 4.0

View file

@ -0,0 +1,3 @@
ogre_orange
TenPlus1
CC BY-SA 4.0

View file

@ -0,0 +1,3 @@
Ankou
TenPlus1
CC BY-SA 4.0

View file

@ -0,0 +1,3 @@
Vampire
TenPlus1
CC BY-SA 4.0

View file

@ -0,0 +1,3 @@
newplanet_player
Jordach
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
exile_player
Dokimi
CC BY-SA 4.0

View file

@ -0,0 +1,3 @@
priest?
sdzen
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
Farmer1
sdzen
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
Farmer2
sdzen
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
Farmer3
sdzen
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
Farmer4
sdzen
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
Farmer5
sdzen
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
Farmer6
sdzen
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
Villager1
sdzen
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
Villager2
sdzen
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
zombie
lucas
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
Villager3
sdzen
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
Villager4
sdzen
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
Villager5
sdzen
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
Villager6
sdzen
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
Farmer7
sdzen
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
Bartender
sdzen
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
Farmer8
sdzen
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
Crowned
sdzen
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
woman
sdzen
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
Villager8
sdzen
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
Crowned2
sdzen
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
Crowned3
sdzen
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
Crowned4
sdzen
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
Villager9
sdzen
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
Aurora Mozilla
MT Aurora
CC BY-SA 3.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 924 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 848 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 816 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 799 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 792 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

View file

@ -52,7 +52,7 @@ minetest.register_node("stained_glass:stained_glass", {
paramtype2 = "color", paramtype2 = "color",
palette = "unifieddyes_palette_extended.png", palette = "unifieddyes_palette_extended.png",
sunlight_propagates = true, sunlight_propagates = true,
use_texture_alpha = true, use_texture_alpha = "blend",
light_source = myglow, light_source = myglow,
is_ground_content = true, is_ground_content = true,
walkable = true, walkable = true,
@ -78,7 +78,7 @@ minetest.register_node("stained_glass:stained_trap_glass", {
paramtype2 = "color", paramtype2 = "color",
palette = "unifieddyes_palette_extended.png", palette = "unifieddyes_palette_extended.png",
sunlight_propagates = true, sunlight_propagates = true,
use_texture_alpha = true, use_texture_alpha = "blend",
light_source = myglow, light_source = myglow,
is_ground_content = true, is_ground_content = true,
walkable = false, walkable = false,

View file

@ -7,8 +7,8 @@ function vehicle_mash.register_vehicle(name, def)
terrain_type = def.terrain_type, terrain_type = def.terrain_type,
collisionbox = def.collisionbox, collisionbox = def.collisionbox,
can_fly = def.can_fly, can_fly = def.can_fly,
can_go_down = def.can_go_down, can_go_down = def.can_go_down, -- Applies only when `can_fly` is enabled
can_go_up = def.can_go_up, can_go_up = def.can_go_up, -- Applies only when `can_fly` is enabled
player_rotation = def.player_rotation, player_rotation = def.player_rotation,
driver_attach_at = def.driver_attach_at, driver_attach_at = def.driver_attach_at,
driver_eye_offset = def.driver_eye_offset, driver_eye_offset = def.driver_eye_offset,
@ -33,8 +33,12 @@ function vehicle_mash.register_vehicle(name, def)
tiles = def.tiles, tiles = def.tiles,
visual_size = def.visual_size, visual_size = def.visual_size,
stepheight = def.stepheight, stepheight = def.stepheight,
max_speed_forward = def.max_speed_forward, max_speed_forward = def.max_speed_forward,
max_speed_reverse = def.max_speed_reverse, max_speed_reverse = def.max_speed_reverse,
max_speed_upwards = def.max_speed_upwards, -- Applies only when `can_fly` is enabled
max_speed_downwards = def.max_speed_downwards, -- Applies only when `can_fly` is enabled
accel = def.accel, accel = def.accel,
braking = def.braking, braking = def.braking,
turn_spd = def.turn_speed, turn_spd = def.turn_speed,

Some files were not shown because too many files have changed in this diff Show more