name changing
@ -1,2 +1,2 @@
|
||||
# light_systems
|
||||
Airport Lighting Systems for Minetest
|
||||
# airutils
|
||||
Airport Utils for Minetest
|
||||
|
@ -1 +1 @@
|
||||
Airport Lighting Systems for Minetest
|
||||
Airport Utils for Minetest
|
||||
|
38
init.lua
@ -1,11 +1,11 @@
|
||||
-- Minetest 5.4.1 : light_systems
|
||||
-- Minetest 5.4.1 : airutils
|
||||
|
||||
light_systems = {}
|
||||
airutils = {}
|
||||
|
||||
function light_systems.PAPIplace(player,pos)
|
||||
function airutils.PAPIplace(player,pos)
|
||||
local dir = minetest.dir_to_facedir(player:get_look_dir())
|
||||
local pos1 = vector.new(pos)
|
||||
core.set_node(pos, {name="light_systems:papi", param2=dir})
|
||||
core.set_node(pos, {name="airutils:papi", param2=dir})
|
||||
local player_name = player:get_player_name()
|
||||
local meta = core.get_meta(pos)
|
||||
meta:set_string("infotext", "PAPI\rOwned by: "..player_name)
|
||||
@ -14,7 +14,7 @@ function light_systems.PAPIplace(player,pos)
|
||||
return true
|
||||
end
|
||||
|
||||
function light_systems.remove(pos)
|
||||
function airutils.remove(pos)
|
||||
local meta = core.get_meta(pos)
|
||||
if meta:get_string("dont_destroy") == "true" then
|
||||
-- when swapping it
|
||||
@ -22,32 +22,32 @@ function light_systems.remove(pos)
|
||||
end
|
||||
end
|
||||
|
||||
function light_systems.canDig(pos, player)
|
||||
function airutils.canDig(pos, player)
|
||||
local meta = core.get_meta(pos)
|
||||
return meta:get_string("dont_destroy") ~= "true"
|
||||
and player:get_player_name() == meta:get_string("owner")
|
||||
end
|
||||
|
||||
light_systems.collision_box = {
|
||||
airutils.collision_box = {
|
||||
type = "fixed",
|
||||
fixed={{-0.5,-0.5,-0.5,0.5,-0.42,0.5},},
|
||||
}
|
||||
|
||||
light_systems.selection_box = {
|
||||
airutils.selection_box = {
|
||||
type = "fixed",
|
||||
fixed={{-0.5,-0.5,-0.5,0.5,1.5,0.5},},
|
||||
}
|
||||
|
||||
light_systems.groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}
|
||||
airutils.groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}
|
||||
|
||||
|
||||
minetest.register_node("light_systems:papi",{
|
||||
minetest.register_node("airutils:papi",{
|
||||
description = "PAPI",
|
||||
inventory_image = "papi.png",
|
||||
wield_image = "papi.png",
|
||||
tiles = {"light_systems_black.png", "light_systems_u_black.png", "light_systems_white.png",
|
||||
"light_systems_metal.png", {name = "light_systems_red.png", backface_culling = true},},
|
||||
groups = light_systems.groups,
|
||||
tiles = {"airutils_black.png", "airutils_u_black.png", "airutils_white.png",
|
||||
"airutils_metal.png", {name = "airutils_red.png", backface_culling = true},},
|
||||
groups = airutils.groups,
|
||||
paramtype2 = "facedir",
|
||||
paramtype = "light",
|
||||
drawtype = "mesh",
|
||||
@ -55,21 +55,21 @@ minetest.register_node("light_systems:papi",{
|
||||
visual_scale = 1.0,
|
||||
light_source = 13,
|
||||
backface_culling = true,
|
||||
selection_box = light_systems.selection_box,
|
||||
collision_box = light_systems.collision_box,
|
||||
can_dig = light_systems.canDig,
|
||||
selection_box = airutils.selection_box,
|
||||
collision_box = airutils.collision_box,
|
||||
can_dig = airutils.canDig,
|
||||
_color = "",
|
||||
on_destruct = light_systems.remove,
|
||||
on_destruct = airutils.remove,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local pos = pointed_thing.above
|
||||
if light_systems.PAPIplace(placer,pos)==true then
|
||||
if airutils.PAPIplace(placer,pos)==true then
|
||||
itemstack:take_item(1)
|
||||
return itemstack
|
||||
else
|
||||
return
|
||||
end
|
||||
end,
|
||||
--on_rightclick=light_systems.gateFormspecHandler,
|
||||
--on_rightclick=airutils.gateFormspecHandler,
|
||||
on_punch = function(pos, node, puncher, pointed_thing)
|
||||
local player_name = puncher:get_player_name()
|
||||
local meta = core.get_meta(pos)
|
||||
|
Before Width: | Height: | Size: 382 B After Width: | Height: | Size: 382 B |
Before Width: | Height: | Size: 114 B After Width: | Height: | Size: 114 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |