2017-06-05 14:57:26 +02:00
|
|
|
--[[
|
|
|
|
|
2017-06-08 20:50:42 +02:00
|
|
|
Tower Crane Mod
|
|
|
|
===============
|
|
|
|
|
2020-01-03 11:54:49 +01:00
|
|
|
Copyright (C) 2017-2020 Joachim Stolberg
|
2017-06-08 20:50:42 +02:00
|
|
|
LGPLv2.1+
|
|
|
|
See LICENSE.txt for more information
|
|
|
|
|
2017-06-10 20:26:53 +02:00
|
|
|
|
2019-09-19 21:40:16 +02:00
|
|
|
Nodes Meta data
|
2021-04-28 18:57:22 +02:00
|
|
|
+--------+
|
2019-09-19 21:40:16 +02:00
|
|
|
| | - last_known_pos as "(x,y,z)"
|
|
|
|
| switch | - last_used
|
|
|
|
| | - running
|
|
|
|
+--------+
|
|
|
|
+--------+
|
|
|
|
| | - owner
|
|
|
|
| base | - width
|
|
|
|
| | - height
|
|
|
|
+--------+ - dir as "(0,0,1)"
|
2017-06-05 14:57:26 +02:00
|
|
|
]]--
|
|
|
|
|
2019-09-19 21:40:16 +02:00
|
|
|
-- for lazy programmers
|
|
|
|
local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
|
|
|
local S2P = minetest.string_to_pos
|
|
|
|
|
2017-08-19 15:21:26 +02:00
|
|
|
-- crane minimum size
|
2021-04-28 18:57:22 +02:00
|
|
|
local MIN_SIZE = 8
|
2017-06-05 14:57:26 +02:00
|
|
|
|
|
|
|
towercrane = {}
|
|
|
|
|
2019-09-19 21:40:16 +02:00
|
|
|
towercrane.S = minetest.get_translator("towercrane")
|
|
|
|
local S = towercrane.S
|
|
|
|
local MP = minetest.get_modpath("towercrane")
|
|
|
|
dofile(MP.."/config.lua")
|
|
|
|
dofile(MP.."/control.lua")
|
2017-06-07 22:37:41 +02:00
|
|
|
|
2019-09-19 21:40:16 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
-- Helper functions
|
|
|
|
-------------------------------------------------------------------------------
|
2017-08-19 15:21:26 +02:00
|
|
|
local function chat(owner, text)
|
|
|
|
if owner ~= nil then
|
|
|
|
minetest.chat_send_player(owner, "[Tower Crane] "..text)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-09-19 21:40:16 +02:00
|
|
|
local function formspec(height, width)
|
|
|
|
local text = ""
|
|
|
|
if height and width then
|
|
|
|
text = height..","..width
|
2017-08-19 15:21:26 +02:00
|
|
|
end
|
2019-09-19 21:40:16 +02:00
|
|
|
return "size[5,4]"..
|
|
|
|
"label[0,0;"..S("Construction area size").."]" ..
|
|
|
|
"field[1,1.5;3,1;size;height,width;"..text.."]" ..
|
2021-04-28 18:57:22 +02:00
|
|
|
"button_exit[1,2;2,1;exit;"..S("Build").."]"
|
2017-08-19 15:21:26 +02:00
|
|
|
end
|
|
|
|
|
2019-09-19 21:40:16 +02:00
|
|
|
local function get_node_lvm(pos)
|
|
|
|
local node = minetest.get_node_or_nil(pos)
|
|
|
|
if node then
|
|
|
|
return node
|
2017-08-19 15:21:26 +02:00
|
|
|
end
|
2019-09-19 21:40:16 +02:00
|
|
|
local vm = minetest.get_voxel_manip()
|
|
|
|
local MinEdge, MaxEdge = vm:read_from_map(pos, pos)
|
|
|
|
local data = vm:get_data()
|
|
|
|
local param2_data = vm:get_param2_data()
|
|
|
|
local area = VoxelArea:new({MinEdge = MinEdge, MaxEdge = MaxEdge})
|
|
|
|
local idx = area:indexp(pos)
|
2021-02-07 14:35:06 +01:00
|
|
|
if data[idx] and param2_data[idx] then
|
|
|
|
return {
|
|
|
|
name = minetest.get_name_from_content_id(data[idx]),
|
|
|
|
param2 = param2_data[idx]
|
|
|
|
}
|
|
|
|
end
|
|
|
|
return {name="ignore", param2=0}
|
2017-08-19 15:21:26 +02:00
|
|
|
end
|
2017-06-05 14:57:26 +02:00
|
|
|
|
|
|
|
local function turnright(dir)
|
2017-06-08 20:50:42 +02:00
|
|
|
local facedir = minetest.dir_to_facedir(dir)
|
|
|
|
return minetest.facedir_to_dir((facedir + 1) % 4)
|
2017-06-05 14:57:26 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
local function turnleft(dir)
|
2017-06-08 20:50:42 +02:00
|
|
|
local facedir = minetest.dir_to_facedir(dir)
|
|
|
|
return minetest.facedir_to_dir((facedir + 3) % 4)
|
2017-06-05 14:57:26 +02:00
|
|
|
end
|
|
|
|
|
2019-09-19 21:40:16 +02:00
|
|
|
-- pos is the base position
|
|
|
|
local function is_crane_running(pos)
|
|
|
|
local switch_pos = {x=pos.x, y=pos.y+1, z=pos.z}
|
|
|
|
return towercrane.is_crane_running(switch_pos)
|
|
|
|
end
|
|
|
|
|
|
|
|
local function get_crane_data(pos)
|
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
local dir = S2P(meta:get_string("dir"))
|
|
|
|
local owner = meta:get_string("owner")
|
|
|
|
local height = meta:get_int("height")
|
|
|
|
local width = meta:get_int("width")
|
|
|
|
if dir and height > 0 and width > 0 and owner ~= "" then
|
|
|
|
return {dir = dir, height = height, width = width, owner = owner}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-07-11 20:15:18 +02:00
|
|
|
-- generic function for contruction and removement
|
|
|
|
local function crane_body_plan(pos, dir, height, width, clbk, tArg)
|
2017-06-08 20:50:42 +02:00
|
|
|
pos.y = pos.y + 1
|
2017-07-11 20:15:18 +02:00
|
|
|
clbk(pos, "towercrane:mast_ctrl_off", tArg)
|
2017-06-08 20:50:42 +02:00
|
|
|
|
2019-09-19 21:40:16 +02:00
|
|
|
for _ = 1,height+1 do
|
2017-06-08 20:50:42 +02:00
|
|
|
pos.y = pos.y + 1
|
2017-07-11 20:15:18 +02:00
|
|
|
clbk(pos, "towercrane:mast", tArg)
|
2017-06-08 20:50:42 +02:00
|
|
|
end
|
2017-06-10 20:26:53 +02:00
|
|
|
|
2017-06-08 20:50:42 +02:00
|
|
|
pos.y = pos.y - 2
|
|
|
|
pos.x = pos.x - dir.x
|
|
|
|
pos.z = pos.z - dir.z
|
2017-07-11 20:15:18 +02:00
|
|
|
clbk(pos, "towercrane:arm2", tArg)
|
2017-06-08 20:50:42 +02:00
|
|
|
pos.x = pos.x - dir.x
|
|
|
|
pos.z = pos.z - dir.z
|
2017-07-11 20:15:18 +02:00
|
|
|
clbk(pos, "towercrane:arm", tArg)
|
2017-06-08 20:50:42 +02:00
|
|
|
pos.x = pos.x - dir.x
|
|
|
|
pos.z = pos.z - dir.z
|
2017-07-11 20:15:18 +02:00
|
|
|
clbk(pos, "towercrane:balance", tArg)
|
2017-06-08 20:50:42 +02:00
|
|
|
pos.x = pos.x + 3 * dir.x
|
|
|
|
pos.z = pos.z + 3 * dir.z
|
2017-06-10 20:26:53 +02:00
|
|
|
|
2017-06-08 20:50:42 +02:00
|
|
|
for i = 1,width do
|
|
|
|
pos.x = pos.x + dir.x
|
|
|
|
pos.z = pos.z + dir.z
|
|
|
|
if i % 2 == 0 then
|
2017-07-11 20:15:18 +02:00
|
|
|
clbk(pos, "towercrane:arm2", tArg)
|
2017-06-08 20:50:42 +02:00
|
|
|
else
|
2017-07-11 20:15:18 +02:00
|
|
|
clbk(pos, "towercrane:arm", tArg)
|
2017-06-08 20:50:42 +02:00
|
|
|
end
|
|
|
|
end
|
2017-06-05 14:57:26 +02:00
|
|
|
end
|
|
|
|
|
2019-09-19 21:40:16 +02:00
|
|
|
-- Check space and protection for the crane
|
2017-10-19 20:29:41 +02:00
|
|
|
local function check_space(pos, dir, height, width, owner)
|
2019-09-19 21:40:16 +02:00
|
|
|
local check = function(pos, node_name, tArg)
|
2017-09-24 12:20:43 +02:00
|
|
|
if minetest.get_node(pos).name ~= "air" then
|
2017-07-11 20:15:18 +02:00
|
|
|
tArg.res = false
|
2017-10-19 20:29:41 +02:00
|
|
|
elseif minetest.is_protected(pos, tArg.owner) then
|
|
|
|
tArg.res = false
|
2017-07-11 20:15:18 +02:00
|
|
|
end
|
2017-06-08 20:50:42 +02:00
|
|
|
end
|
2017-10-19 20:29:41 +02:00
|
|
|
local tArg = {res = true, owner = owner}
|
2019-09-19 21:40:16 +02:00
|
|
|
crane_body_plan(table.copy(pos), dir, height, width, check, tArg)
|
2017-07-11 20:15:18 +02:00
|
|
|
return tArg.res
|
|
|
|
end
|
2017-06-08 20:50:42 +02:00
|
|
|
|
2019-09-19 21:40:16 +02:00
|
|
|
local function construct_crane(pos, dir, height, width)
|
2017-07-11 20:15:18 +02:00
|
|
|
local add = function(pos, node_name, tArg)
|
2019-09-19 21:40:16 +02:00
|
|
|
minetest.add_node(pos, {
|
2021-04-28 18:57:22 +02:00
|
|
|
name = node_name,
|
2019-09-19 21:40:16 +02:00
|
|
|
param2 = minetest.dir_to_facedir(tArg.dir)})
|
2017-07-11 20:15:18 +02:00
|
|
|
end
|
|
|
|
local tArg = {dir = dir}
|
|
|
|
crane_body_plan(table.copy(pos), dir, height, width, add, tArg)
|
|
|
|
end
|
2017-06-10 20:26:53 +02:00
|
|
|
|
2017-07-11 20:15:18 +02:00
|
|
|
local function remove_crane(pos, dir, height, width)
|
|
|
|
local remove = function(pos, node_name, tArg)
|
2019-09-19 21:40:16 +02:00
|
|
|
local node = get_node_lvm(pos)
|
|
|
|
if node.name == node_name or node.name == "towercrane:mast_ctrl_on" then
|
2017-07-11 20:15:18 +02:00
|
|
|
minetest.remove_node(pos)
|
2017-06-08 20:50:42 +02:00
|
|
|
end
|
|
|
|
end
|
2017-08-27 15:10:42 +02:00
|
|
|
crane_body_plan(table.copy(pos), dir, height, width, remove, {})
|
2017-06-05 14:57:26 +02:00
|
|
|
end
|
|
|
|
|
2019-09-19 21:40:16 +02:00
|
|
|
-- pos is the base position
|
|
|
|
local function is_my_crane(pos, player)
|
|
|
|
if minetest.check_player_privs(player, "server") then
|
|
|
|
return true
|
2017-06-10 20:26:53 +02:00
|
|
|
end
|
2019-09-19 21:40:16 +02:00
|
|
|
-- check protection
|
|
|
|
local player_name = player and player:get_player_name() or ""
|
|
|
|
if minetest.is_protected(pos, player_name) then
|
|
|
|
return false
|
2017-06-10 20:26:53 +02:00
|
|
|
end
|
2019-09-19 21:40:16 +02:00
|
|
|
-- check owner
|
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
if not meta or player_name ~= meta:get_string("owner") then
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
return true
|
2017-06-10 20:26:53 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
-- Check user input (height, width)
|
|
|
|
local function check_input(fields)
|
|
|
|
local size = string.split(fields.size, ",")
|
|
|
|
if #size == 2 then
|
|
|
|
local height = tonumber(size[1])
|
|
|
|
local width = tonumber(size[2])
|
|
|
|
if height ~= nil and width ~= nil then
|
2017-08-19 15:21:26 +02:00
|
|
|
height = math.max(height, MIN_SIZE)
|
2017-06-10 20:26:53 +02:00
|
|
|
height = math.min(height, towercrane.max_height)
|
2017-08-19 15:21:26 +02:00
|
|
|
width = math.max(width, MIN_SIZE)
|
2017-06-10 20:26:53 +02:00
|
|
|
width = math.min(width, towercrane.max_width)
|
|
|
|
return height, width
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return 0, 0
|
|
|
|
end
|
|
|
|
|
2019-09-19 21:40:16 +02:00
|
|
|
-- pos is the base position
|
|
|
|
function towercrane.get_crane_down(pos)
|
|
|
|
local data = get_crane_data(pos)
|
|
|
|
if data then
|
|
|
|
remove_crane(pos, data.dir, data.height, data.width)
|
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
meta:set_string("formspec", formspec(data.height, data.width))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
local function build_crane_up(pos, owner, height, width)
|
|
|
|
if height > 0 and width > 0 then
|
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
local dir = S2P(meta:get_string("dir"))
|
|
|
|
if dir then
|
|
|
|
if check_space(pos, dir, height, width, owner) then
|
|
|
|
construct_crane(pos, dir, height, width)
|
|
|
|
meta:set_int("height", height)
|
|
|
|
meta:set_int("width", width)
|
|
|
|
meta:set_string("infotext", S("Owner")..": "..owner..
|
|
|
|
", "..S("Crane size")..": "..height..","..width)
|
|
|
|
meta:set_string("formspec", formspec(height, width))
|
|
|
|
else
|
2022-11-05 10:01:35 +01:00
|
|
|
chat(owner, S("Area is protected or not enough space for the crane!"))
|
2019-09-19 21:40:16 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
else
|
|
|
|
chat(owner, S("Invalid input!"))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
-- Nodes
|
|
|
|
-------------------------------------------------------------------------------
|
2017-06-05 14:57:26 +02:00
|
|
|
minetest.register_node("towercrane:base", {
|
2019-09-19 21:40:16 +02:00
|
|
|
description = S("Tower Crane Base"),
|
2020-03-15 12:13:23 +01:00
|
|
|
inventory_image = "[inventorycube{towercrane_mast.png{towercrane_mast.png{towercrane_mast.png",
|
2017-06-08 20:50:42 +02:00
|
|
|
tiles = {
|
2020-03-15 12:13:23 +01:00
|
|
|
"towercrane_base.png^towercrane_arrow.png",
|
|
|
|
"towercrane_base.png^towercrane_screws.png",
|
|
|
|
"towercrane_base.png^towercrane_screws.png",
|
|
|
|
"towercrane_base.png^towercrane_screws.png",
|
|
|
|
"towercrane_base.png^towercrane_screws.png",
|
|
|
|
"towercrane_base.png^towercrane_screws.png",
|
2017-06-08 20:50:42 +02:00
|
|
|
},
|
2017-10-19 20:29:41 +02:00
|
|
|
paramtype = "light",
|
2017-06-08 20:50:42 +02:00
|
|
|
paramtype2 = "facedir",
|
2017-10-19 20:29:41 +02:00
|
|
|
sunlight_propagates = true,
|
2019-09-19 21:40:16 +02:00
|
|
|
sounds = default.node_sound_metal_defaults(),
|
2017-06-08 20:50:42 +02:00
|
|
|
is_ground_content = false,
|
|
|
|
groups = {cracky=2},
|
|
|
|
|
|
|
|
-- set meta data (form for crane height and width, dir of the arm)
|
|
|
|
after_place_node = function(pos, placer)
|
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
local owner = placer:get_player_name()
|
|
|
|
meta:set_string("owner", owner)
|
2019-09-19 21:40:16 +02:00
|
|
|
meta:set_string("formspec", formspec())
|
2017-06-08 20:50:42 +02:00
|
|
|
|
|
|
|
local fdir = minetest.dir_to_facedir(placer:get_look_dir(), false)
|
|
|
|
local dir = minetest.facedir_to_dir(fdir)
|
2019-09-19 21:40:16 +02:00
|
|
|
meta:set_string("dir", P2S(dir))
|
2017-06-08 20:50:42 +02:00
|
|
|
end,
|
|
|
|
|
2020-06-30 08:23:17 +02:00
|
|
|
on_rotate = function(pos, node, player, mode, new_facedir)
|
|
|
|
-- check whether crane is built up
|
|
|
|
local pos_above = {x=pos.x, y=pos.y+1, z=pos.z}
|
|
|
|
local node_above = minetest.get_node(pos_above)
|
|
|
|
|
|
|
|
if node_above.name == "towercrane:mast_ctrl_on"
|
|
|
|
or node_above.name == "towercrane:mast_ctrl_off" then
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
|
|
|
|
-- only allow rotation around y-axis
|
|
|
|
new_facedir = new_facedir % 4
|
|
|
|
|
|
|
|
local dir = minetest.facedir_to_dir(new_facedir)
|
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
meta:set_string("dir", P2S(dir))
|
|
|
|
|
|
|
|
node.param2 = new_facedir
|
|
|
|
minetest.swap_node(pos, node)
|
|
|
|
return true
|
|
|
|
end,
|
|
|
|
|
2021-04-28 18:57:22 +02:00
|
|
|
-- evaluate user input (height, width),
|
2019-09-19 21:40:16 +02:00
|
|
|
-- destroy old crane and build a new one with
|
2017-06-08 20:50:42 +02:00
|
|
|
-- the given size
|
|
|
|
on_receive_fields = function(pos, formname, fields, player)
|
|
|
|
if fields.size == nil then
|
|
|
|
return
|
|
|
|
end
|
2019-09-19 21:40:16 +02:00
|
|
|
if is_crane_running(pos) then
|
2017-09-24 12:20:43 +02:00
|
|
|
return
|
|
|
|
end
|
2019-09-19 21:40:16 +02:00
|
|
|
if not is_my_crane(pos, player) then
|
2017-06-08 20:50:42 +02:00
|
|
|
return
|
|
|
|
end
|
2019-09-19 21:40:16 +02:00
|
|
|
-- destroy old crane
|
|
|
|
towercrane.get_crane_down(pos)
|
|
|
|
-- evaluate user input and build new
|
|
|
|
local height, width = check_input(fields)
|
|
|
|
build_crane_up(pos, player:get_player_name(), height, width)
|
2017-06-08 20:50:42 +02:00
|
|
|
end,
|
|
|
|
|
2017-09-20 23:11:27 +02:00
|
|
|
can_dig = function(pos, player)
|
2019-09-19 21:40:16 +02:00
|
|
|
if minetest.check_player_privs(player, "server") then
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
if is_crane_running(pos) then
|
2017-09-24 12:20:43 +02:00
|
|
|
return false
|
|
|
|
end
|
2019-09-19 21:40:16 +02:00
|
|
|
if not is_my_crane(pos, player) then
|
2017-09-24 12:20:43 +02:00
|
|
|
return false
|
2017-09-20 23:11:27 +02:00
|
|
|
end
|
2017-09-24 12:20:43 +02:00
|
|
|
return true
|
2017-09-20 23:11:27 +02:00
|
|
|
end,
|
2021-04-28 18:57:22 +02:00
|
|
|
|
2017-06-08 20:50:42 +02:00
|
|
|
on_destruct = function(pos)
|
2019-09-19 21:40:16 +02:00
|
|
|
towercrane.get_crane_down(pos)
|
2017-06-08 20:50:42 +02:00
|
|
|
end,
|
2017-06-05 14:57:26 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("towercrane:balance", {
|
2019-09-19 21:40:16 +02:00
|
|
|
description = S("Tower Crane Balance"),
|
2017-06-08 20:50:42 +02:00
|
|
|
tiles = {
|
2021-04-28 18:57:22 +02:00
|
|
|
"towercrane_base.png^towercrane_screws.png^morelights_extras_blocklight.png",
|
2017-06-08 20:50:42 +02:00
|
|
|
},
|
2017-10-19 20:29:41 +02:00
|
|
|
paramtype = "light",
|
2017-06-08 20:50:42 +02:00
|
|
|
paramtype2 = "facedir",
|
2021-04-28 18:57:22 +02:00
|
|
|
light_source = 12,
|
2017-10-19 20:29:41 +02:00
|
|
|
sunlight_propagates = true,
|
2017-06-08 20:50:42 +02:00
|
|
|
is_ground_content = false,
|
|
|
|
groups = {crumbly=0, not_in_creative_inventory=1},
|
2017-06-05 14:57:26 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("towercrane:mast", {
|
2019-09-19 21:40:16 +02:00
|
|
|
description = S("Tower Crane Mast"),
|
2017-06-08 20:50:42 +02:00
|
|
|
drawtype = "glasslike_framed",
|
|
|
|
tiles = {
|
|
|
|
"towercrane_mast.png",
|
2020-03-15 12:13:23 +01:00
|
|
|
{
|
|
|
|
name = "towercrane_mast.png",
|
|
|
|
backface_culling = false,
|
|
|
|
},
|
2017-06-08 20:50:42 +02:00
|
|
|
},
|
2017-10-19 20:29:41 +02:00
|
|
|
paramtype = "light",
|
2017-06-08 20:50:42 +02:00
|
|
|
paramtype2 = "facedir",
|
2017-10-19 20:29:41 +02:00
|
|
|
sunlight_propagates = true,
|
2017-06-08 20:50:42 +02:00
|
|
|
is_ground_content = false,
|
|
|
|
groups = {crumbly=0, not_in_creative_inventory=1},
|
2017-06-05 14:57:26 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("towercrane:arm", {
|
2019-09-19 21:40:16 +02:00
|
|
|
description = S("Tower Crane Arm"),
|
2017-06-08 20:50:42 +02:00
|
|
|
drawtype = "glasslike_framed",
|
|
|
|
tiles = {
|
|
|
|
"towercrane_arm.png",
|
2020-03-15 12:13:23 +01:00
|
|
|
{
|
|
|
|
name = "towercrane_arm.png",
|
|
|
|
backface_culling = false,
|
|
|
|
},
|
2017-06-08 20:50:42 +02:00
|
|
|
},
|
2017-10-19 20:29:41 +02:00
|
|
|
paramtype = "light",
|
2017-06-08 20:50:42 +02:00
|
|
|
paramtype2 = "facedir",
|
2017-10-19 20:29:41 +02:00
|
|
|
sunlight_propagates = true,
|
2017-06-08 20:50:42 +02:00
|
|
|
is_ground_content = false,
|
|
|
|
groups = {crumbly=0, not_in_creative_inventory=1},
|
2017-06-05 14:57:26 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("towercrane:arm2", {
|
2019-09-19 21:40:16 +02:00
|
|
|
description = S("Tower Crane Arm2"),
|
2017-06-08 20:50:42 +02:00
|
|
|
drawtype = "glasslike_framed",
|
|
|
|
tiles = {
|
|
|
|
"towercrane_arm2.png",
|
2020-03-15 12:13:23 +01:00
|
|
|
{
|
|
|
|
name = "towercrane_arm2.png",
|
|
|
|
backface_culling = false,
|
|
|
|
},
|
2017-06-08 20:50:42 +02:00
|
|
|
},
|
2017-10-19 20:29:41 +02:00
|
|
|
paramtype = "light",
|
2017-06-08 20:50:42 +02:00
|
|
|
paramtype2 = "facedir",
|
2017-10-19 20:29:41 +02:00
|
|
|
sunlight_propagates = true,
|
2017-06-08 20:50:42 +02:00
|
|
|
is_ground_content = false,
|
|
|
|
groups = {crumbly=0, not_in_creative_inventory=1},
|
2017-06-05 14:57:26 +02:00
|
|
|
})
|
2017-06-06 21:42:02 +02:00
|
|
|
|
2017-06-08 20:50:42 +02:00
|
|
|
if towercrane.recipe then
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "towercrane:base",
|
|
|
|
recipe = {
|
|
|
|
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
|
|
|
|
{"default:steel_ingot", "", ""},
|
|
|
|
{"default:steel_ingot", "dye:yellow", ""}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
end
|
2017-06-06 21:42:02 +02:00
|
|
|
|
2019-09-19 21:40:16 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
-- export
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
towercrane.turnright = turnright
|
|
|
|
towercrane.turnleft = turnleft
|
|
|
|
towercrane.is_my_crane = is_my_crane
|
|
|
|
towercrane.get_crane_data = get_crane_data
|