Merge remote-tracking branch 'upstream/master'

This commit is contained in:
bri cassa 2023-11-22 23:44:54 +01:00
commit 1fcfd2a98d
30 changed files with 164 additions and 13 deletions

View File

@ -0,0 +1,3 @@
# textdomain: mesecons
Mesecons=Mesecons

View File

@ -0,0 +1,2 @@
# textdomain: mesecons_blinkyplant
Blinky Plant=Blinkpflanze

View File

@ -0,0 +1,2 @@
# textdomain: mesecons_button
Button=Taster

View File

@ -0,0 +1,5 @@
# textdomain: mesecons_commandblock
Say <text> as the server=<Text> als Server sagen
Say <text> to <name> privately=<Text> an <Name> privat senden
Set health of <name> to <value> hitpoints=Gesundheit von <Name> auf <Wert> Trefferpunkte setzen
Command Block=Befehlsblock

View File

@ -0,0 +1,3 @@
# textdomain: mesecons_delayer
Delayer=Verzögerer
You hacker you=Du Hacker, Du

View File

@ -0,0 +1,3 @@
# textdomain: mesecons_detector
Player Detector=Spielerdetektor
Node Detector=Blockdetektor

View File

@ -0,0 +1,8 @@
# textdomain: mesecons_extrawires
Insulated Mesecon Corner=Isolierte Meseconecke
Insulated Mesecon Crossover=Isolierter Meseconübergang
You hacker you!=Sie Hacker!
Insulated Mesecon Double Corner=Isolierte Mesecondoppelecke
Mese Wire=Mesedraht
Insulated Mesecon T-junction=Isolierte Mesecongabelung
Vertical Mesecon=Vertikaler Mesecon

View File

@ -0,0 +1,3 @@
# textdomain: mesecons_fpga
FPGA=FPGA
FPGA Programmer=FPGA-Programmierer

View File

@ -0,0 +1,2 @@
# textdomain: mesecons_hydroturbine
Water Turbine=Wasserturbine

View File

@ -0,0 +1,2 @@
# textdomain: mesecons_insulated
Straight Insulated Mesecon=Isolierte Mesecongerade

View File

@ -0,0 +1,2 @@
# textdomain: mesecons_lamp
Mesecon Lamp=Meseconlampe

View File

@ -0,0 +1,13 @@
# textdomain: mesecons_lightstone
Red Lightstone=Roter Leuchtstein
Green Lightstone=Grüner Leuchtstein
Blue Lightstone=Blauer Leuchtstein
Grey Lightstone=Grauer Leuchtstein
Dark Grey Lightstone=Dunkelgrauer Leuchtstein
Yellow Lightstone=Gelber Leuchtstein
Orange Lightstone=Orange Leuchtstein
White Lightstone=Weißer Leuchtstein
Pink Lightstone=Rosa Leuchtstein
Magenta Lightstone=Magenta Leuchtstein
Cyan Lightstone=Türkiser Leuchtstein
Violet Lightstone=Violetter Leuchtstein

View File

@ -238,6 +238,16 @@ local function safe_string_find(...)
return string.find(...)
end
-- do not allow pattern matching in string.split (see string.find for details)
local function safe_string_split(...)
if select(5, ...) then
debug.sethook() -- Clear hook
error("string.split: 'sep_is_pattern' (fifth parameter) may not be used in a Luacontroller")
end
return string.split(...)
end
local function remove_functions(x)
local tp = type(x)
if tp == "function" then
@ -507,6 +517,7 @@ local function create_environment(pos, mem, event, itbl, send_warning)
reverse = string.reverse,
sub = string.sub,
find = safe_string_find,
split = safe_string_split,
},
math = {
abs = math.abs,

View File

@ -0,0 +1,2 @@
# textdomain: mesecons_luacontroller
Luacontroller=Luacontroller

View File

@ -0,0 +1,4 @@
# textdomain: mesecons_materials
Glue=Klebstoff
Fiber=Faser
Silicon=Silizium

View File

@ -0,0 +1,2 @@
# textdomain: mesecons_microcontroller
Microcontroller=Mikrocontroller

View File

@ -0,0 +1,5 @@
# textdomain: mesecons_movestones
Movestone=Laufstein
Sticky Movestone=Klebriger Laufstein
Vertical Movestone=Vertikaler Laufstein
Vertical Sticky Movestone=Vertikaler klebriger Laufstein

View File

@ -53,11 +53,16 @@ end
-- tests if the node can be pushed into, e.g. air, water, grass
local function node_replaceable(name)
if minetest.registered_nodes[name] then
return minetest.registered_nodes[name].buildable_to or false
local nodedef = minetest.registered_nodes[name]
-- everything that can be an mvps stopper (unknown nodes and nodes in the
-- mvps_stoppers table) must not be replacable
-- Note: ignore (a stopper) is buildable_to, but we do not want to push into it
if not nodedef or mesecon.mvps_stoppers[name] then
return false
end
return false
return nodedef.buildable_to or false
end
function mesecon.mvps_get_stack(pos, dir, maximum, all_pull_sticky)

View File

@ -0,0 +1,2 @@
# textdomain: mesecons_noteblock
Noteblock=Notenblock

View File

@ -0,0 +1,7 @@
# textdomain: mesecons_pistons
Piston=Kolben
Activated Piston Base=Aktivierter Kolbenkörper
Piston Pusher=Kolbenschieber
Sticky Piston=Haftender Kolben
Activated Sticky Piston Base=Aktivierter haftender Kolbenkörper
Sticky Piston Pusher=Haftender Kolbenschieber

View File

@ -0,0 +1,2 @@
# textdomain: mesecons_powerplant
Power Plant=Energiepflanze

View File

@ -10,6 +10,49 @@ local pp_box_on = {
fixed = { -7/16, -8/16, -7/16, 7/16, -7.5/16, 7/16 },
}
local function obj_touching_plate_pos(obj_ref, plate_pos)
local obj_pos = obj_ref:get_pos()
local props = obj_ref:get_properties()
if not (props and obj_pos and not obj_ref:get_attach()) then
return false
end
local collisionbox = props.collisionbox
local physical = props.physical
local is_player = obj_ref:is_player()
local luaentity = obj_ref:get_luaentity()
local is_item = luaentity and luaentity.name == "__builtin:item"
if not (collisionbox and physical or is_player or is_item) then
return false
end
local plate_x_min = plate_pos.x - 7 / 16
local plate_x_max = plate_pos.x + 7 / 16
local plate_z_min = plate_pos.z - 7 / 16
local plate_z_max = plate_pos.z + 7 / 16
local plate_y_min = plate_pos.y - 8 / 16
local plate_y_max = plate_pos.y - 6.5 / 16
local obj_x_min = obj_pos.x + collisionbox[1]
local obj_x_max = obj_pos.x + collisionbox[4]
local obj_z_min = obj_pos.z + collisionbox[3]
local obj_z_max = obj_pos.z + collisionbox[6]
local obj_y_min = obj_pos.y + collisionbox[2]
local obj_y_max = obj_pos.y + collisionbox[5]
if
obj_y_min < plate_y_max and
obj_y_max > plate_y_min and
obj_x_min < plate_x_max and
obj_x_max > plate_x_min and
obj_z_min < plate_z_max and
obj_z_max > plate_z_min
then
return true
end
return false
end
local function pp_on_timer(pos)
local node = minetest.get_node(pos)
local basename = minetest.registered_nodes[node.name].pressureplate_basename
@ -18,19 +61,21 @@ local function pp_on_timer(pos)
-- For some reason the first time on_timer is called, the pos is wrong
if not basename then return end
local objs = minetest.get_objects_inside_radius(pos, 1)
local objs = minetest.get_objects_inside_radius(pos, 1)
local obj_touching = false
for k, obj in pairs(objs) do
if obj_touching_plate_pos(obj, pos) then
obj_touching = true
break
end
end
if objs[1] == nil and node.name == basename .. "_on" then
if not obj_touching and node.name == basename .. "_on" then
minetest.set_node(pos, {name = basename .. "_off"})
mesecon.receptor_off(pos, mesecon.rules.pplate)
elseif node.name == basename .. "_off" then
for k, obj in pairs(objs) do
local objpos = obj:get_pos()
if objpos.y > pos.y-1 and objpos.y < pos.y then
minetest.set_node(pos, {name = basename .. "_on"})
mesecon.receptor_on(pos, mesecon.rules.pplate )
end
end
elseif obj_touching and node.name == basename .. "_off" then
minetest.set_node(pos, {name = basename .. "_on"})
mesecon.receptor_on(pos, mesecon.rules.pplate )
end
return true
end

View File

@ -0,0 +1,3 @@
# textdomain: mesecons_pressureplates
Wooden Pressure Plate=Holzdruckplatte
Stone Pressure Plate=Steindruckplatte

View File

@ -0,0 +1,3 @@
# textdomain: mesecons_random
Removestone=Verschwindestein
Ghoststone=Geisterstein

View File

@ -0,0 +1,2 @@
# textdomain: mesecons_solarpanel
Solar Panel=Solarmodul

View File

@ -0,0 +1,2 @@
# textdomain: mesecons_stickyblocks
Sticky Block=Klebeblock

View File

@ -0,0 +1,2 @@
# textdomain: mesecons_switch
Switch=Schalter

View File

@ -0,0 +1,2 @@
# textdomain: mesecons_torch
Mesecon Torch=Meseconfackel

View File

@ -0,0 +1,2 @@
# textdomain: mesecons_walllever
Lever=Wandschalter

View File

@ -0,0 +1,2 @@
# textdomain: mesecons_wires
Mesecon=Mesecon