2016-02-25 23:38:19 +01:00
|
|
|
-- A telling machine. Call this file with the exchange argument.
|
2017-06-01 12:14:13 +02:00
|
|
|
local exchange, formlib = ...
|
2020-09-11 08:21:51 +02:00
|
|
|
local S = minetest.get_translator("global_exchange")
|
2016-02-25 23:38:19 +01:00
|
|
|
|
|
|
|
local atm_form = "global_exchange:atm_form"
|
2018-12-31 13:36:52 +01:00
|
|
|
local atm_pos = {}
|
2016-02-25 23:38:19 +01:00
|
|
|
|
2017-06-01 12:14:13 +02:00
|
|
|
local unique = (function(unique_num)
|
|
|
|
return function()
|
|
|
|
unique_num = unique_num + 1
|
|
|
|
return unique_num
|
|
|
|
end
|
|
|
|
end)(0)
|
2016-02-25 23:38:19 +01:00
|
|
|
|
2020-01-07 23:04:59 +01:00
|
|
|
local coins = {
|
|
|
|
[1] = "bitchange:minecoinblock", [2] = "bitchange:minecoin", [3] = "bitchange:mineninth",
|
|
|
|
[4] = "maptools:gold_coin", [5] = "maptools:silver_coin", [6] = "maptools:copper_coin"
|
|
|
|
}
|
|
|
|
|
2018-12-31 13:36:52 +01:00
|
|
|
local coins_convert = {
|
2020-01-07 23:04:59 +01:00
|
|
|
[coins[6]]=1, [coins[5]]=9, [coins[4]]=81, [coins[3]]=729, [coins[2]]=6561, [coins[1]]=59049,
|
|
|
|
["minercantile:copper_coin"]=1, ["minercantile:silver_coin"]=9, ["minercantile:gold_coin"]=81
|
2018-12-31 13:36:52 +01:00
|
|
|
}
|
2016-02-25 23:38:19 +01:00
|
|
|
|
2020-01-07 23:04:59 +01:00
|
|
|
local function withdraw_fs(fs, p_name, amount)
|
2018-12-31 13:36:52 +01:00
|
|
|
local spos = atm_pos[p_name].x..","..atm_pos[p_name].y..","..atm_pos[p_name].z
|
2020-01-07 23:04:59 +01:00
|
|
|
local inv = minetest.get_inventory({ type = "node", pos={x=atm_pos[p_name].x, y=atm_pos[p_name].y, z=atm_pos[p_name].z} })
|
|
|
|
|
|
|
|
local msg = ""
|
|
|
|
local w_amount = tonumber(amount)
|
|
|
|
if w_amount and math.floor(w_amount) == w_amount and w_amount > 0 then
|
2020-09-11 08:21:51 +02:00
|
|
|
local succ, err = exchange:give_credits(p_name, 0 - w_amount, S("Cash withdrawal: (-@1)", w_amount))
|
2020-01-07 23:04:59 +01:00
|
|
|
if succ then
|
|
|
|
local index = 1
|
|
|
|
repeat
|
|
|
|
local m = math.floor(w_amount / coins_convert[coins[index]])
|
|
|
|
if m > 0 then
|
|
|
|
inv:add_item( "main", ItemStack({ name = coins[index], count = m }) )
|
|
|
|
end
|
|
|
|
w_amount = w_amount - (coins_convert[coins[index]] * m)
|
|
|
|
index = index + 1
|
|
|
|
until ( w_amount == 0)
|
|
|
|
else
|
|
|
|
msg = err
|
|
|
|
end
|
|
|
|
elseif w_amount then
|
2020-09-11 08:21:51 +02:00
|
|
|
msg = S("Invalid number ! Must be an Integer > 0")
|
2020-01-07 23:04:59 +01:00
|
|
|
end
|
2018-12-31 13:36:52 +01:00
|
|
|
|
2020-01-07 23:04:59 +01:00
|
|
|
local balance = exchange:get_balance(p_name)
|
2019-03-08 23:46:27 +01:00
|
|
|
|
2020-01-07 23:04:59 +01:00
|
|
|
fs:size(8,10)
|
|
|
|
|
2018-12-31 13:36:52 +01:00
|
|
|
if not balance then
|
2020-09-11 08:21:51 +02:00
|
|
|
fs:label(0.5, 0.5, S("You don't have an account."))
|
2018-12-31 13:36:52 +01:00
|
|
|
else
|
2020-09-11 08:21:51 +02:00
|
|
|
fs:label(3,8.9, S("Balance: @1", balance))
|
|
|
|
fs:field(0.75, 1.25, 3.25, 1, "w_amount", S("Desired amount:"))
|
|
|
|
fs:button(4, 1, 3.25, 1, "withdraw", S("Get !"))
|
|
|
|
fs:label(1, 2.25, S("Or deposit your coins to credit your account:"))
|
2020-01-07 23:04:59 +01:00
|
|
|
fs:list(1,3,6,1, "nodemeta:"..spos, "main")
|
|
|
|
fs:list(0,4.25, 8,4, "current_player", "main")
|
|
|
|
fs("listring[current_player;main]"..
|
|
|
|
"listring[nodemeta:"..spos..";main]"
|
2019-03-08 23:46:27 +01:00
|
|
|
)
|
2020-01-07 23:04:59 +01:00
|
|
|
fs:label(0,9.75, msg)
|
2018-12-31 13:36:52 +01:00
|
|
|
end
|
2020-09-11 08:21:51 +02:00
|
|
|
fs:button(0,8.75, 2,1, "logout", S("Log Out"))
|
2018-12-31 13:36:52 +01:00
|
|
|
end
|
2016-02-25 23:38:19 +01:00
|
|
|
|
2017-06-01 12:14:13 +02:00
|
|
|
local function info_fs(fs, p_name)
|
|
|
|
local balance = exchange:get_balance(p_name)
|
2016-02-25 23:38:19 +01:00
|
|
|
|
2017-06-01 12:14:13 +02:00
|
|
|
fs:size(4,3)
|
|
|
|
|
|
|
|
if balance then
|
2020-09-11 08:21:51 +02:00
|
|
|
fs:label(0.5,0.5, S("Balance: @1", balance))
|
2017-06-01 12:14:13 +02:00
|
|
|
else
|
2020-09-11 08:21:51 +02:00
|
|
|
fs:label(0.5,0.5, S("You don't have an account."))
|
2017-06-01 12:14:13 +02:00
|
|
|
end
|
2016-02-25 23:38:19 +01:00
|
|
|
|
2020-09-11 08:21:51 +02:00
|
|
|
fs:button(1,2, 2,1, "logout", S("Log Out"))
|
2016-02-25 23:38:19 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
|
2017-06-01 12:14:13 +02:00
|
|
|
local function wire_fs(fs, p_name)
|
|
|
|
local balance = exchange:get_balance(p_name)
|
2016-02-25 23:38:19 +01:00
|
|
|
|
2017-06-01 12:14:13 +02:00
|
|
|
fs:size(4,5)
|
2016-02-25 23:38:19 +01:00
|
|
|
|
2017-06-01 12:14:13 +02:00
|
|
|
if balance then
|
2017-06-03 23:40:32 +02:00
|
|
|
-- To detect duplicate/stale form submission
|
2017-06-01 12:14:13 +02:00
|
|
|
fs:field(-100, -100, 0,0, "trans_id", "", unique())
|
2016-02-25 23:38:19 +01:00
|
|
|
|
2020-09-11 08:21:51 +02:00
|
|
|
fs:label(0.50,0.325, S("Balance: @1", balance))
|
|
|
|
fs:field(0.75,1.750, 3,1, "recipient", S("Send to:"), "")
|
|
|
|
fs:field(0.75,3.000, 3,1, "amount", S("Amount"), "")
|
2016-02-25 23:38:19 +01:00
|
|
|
|
2020-09-11 08:21:51 +02:00
|
|
|
fs:button(0,4.25, 2,1, "logout", S("Log Out"))
|
|
|
|
fs:button(2,4.25, 2,1, "send", S("Send"))
|
2016-02-25 23:38:19 +01:00
|
|
|
else
|
2020-09-11 08:21:51 +02:00
|
|
|
fs:button(0,4, 2,1, "logout", S("Back"))
|
|
|
|
fs:label(0.5,0.5, S("You don't have an account."))
|
2016-02-25 23:38:19 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2017-06-01 12:14:13 +02:00
|
|
|
local function send_fs(fs, p_name, receiver, amt_str)
|
|
|
|
fs:size(10,3)
|
2016-02-25 23:38:19 +01:00
|
|
|
|
2020-09-11 08:21:51 +02:00
|
|
|
fs:button(4,2, 2,1, "wire", S("Back"))
|
2016-02-25 23:38:19 +01:00
|
|
|
|
2017-06-01 12:14:13 +02:00
|
|
|
local amt = tonumber(amt_str)
|
|
|
|
local msg = nil
|
|
|
|
|
|
|
|
if not amt or amt <= 0 then
|
2020-09-11 08:21:51 +02:00
|
|
|
msg = S("Invalid transfer amount.")
|
2017-06-01 12:14:13 +02:00
|
|
|
else
|
|
|
|
local succ, err = exchange:transfer_credits(p_name, receiver, amt)
|
|
|
|
|
|
|
|
if not succ then
|
|
|
|
msg = "Error: " .. err
|
|
|
|
else
|
|
|
|
msg = "Successfully sent " .. amt ..
|
|
|
|
" credits to " .. receiver .. "."
|
|
|
|
end
|
2016-02-25 23:38:19 +01:00
|
|
|
end
|
|
|
|
|
2017-06-01 12:14:13 +02:00
|
|
|
fs:label(0.5,0.5, msg)
|
2016-02-25 23:38:19 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
|
2017-06-01 12:14:13 +02:00
|
|
|
local function log_fs(fs, p_name)
|
|
|
|
fs:size(14,8)
|
2016-02-25 23:38:19 +01:00
|
|
|
|
2020-09-11 08:21:51 +02:00
|
|
|
fs:label(0,0, S("Transaction Log"))
|
2016-02-25 23:38:19 +01:00
|
|
|
|
2017-06-03 23:40:32 +02:00
|
|
|
fs:element("tablecolumns", "text", "text")
|
2016-03-05 11:47:35 +01:00
|
|
|
|
2017-06-03 23:40:32 +02:00
|
|
|
fs("table[0,0.75;13.75,6.75;log_table;Time,Message")
|
2017-06-01 12:14:13 +02:00
|
|
|
for _, entry in ipairs(exchange:player_log(p_name)) do
|
2017-06-03 23:40:32 +02:00
|
|
|
fs(","):escape_list(entry.Time, entry.Message)
|
2016-02-25 23:38:19 +01:00
|
|
|
end
|
2017-06-01 12:14:13 +02:00
|
|
|
fs("]")
|
2016-02-25 23:38:19 +01:00
|
|
|
|
2020-09-11 08:21:51 +02:00
|
|
|
fs:button(6,7.5, 2,1, "logout", S("Log Out"))
|
2017-06-01 12:14:13 +02:00
|
|
|
end
|
2016-02-27 04:45:32 +01:00
|
|
|
|
|
|
|
|
2017-06-01 12:14:13 +02:00
|
|
|
local function main_menu_fs(fs, p_name)
|
2020-01-07 23:04:59 +01:00
|
|
|
fs:size(8,2)
|
2020-09-11 08:21:51 +02:00
|
|
|
fs:button(0,0.125, 4,1, "withdraw", S("Cash deposit and withdrawal"))
|
|
|
|
fs:button(4,0.125, 2,1, "info", S("Account Info"))
|
|
|
|
fs:button(6,0.125, 2,1, "wire", S("Wire Monies"))
|
|
|
|
fs:button(0.50, 1.125, 7, 1, "transaction_log", S("Transaction Log"))
|
2016-02-27 04:45:32 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
|
2017-06-01 12:14:13 +02:00
|
|
|
local function show_atm_form(fs_fn, p_name, ...)
|
|
|
|
local fs = formlib.Builder()
|
|
|
|
fs_fn(fs, p_name, ...)
|
|
|
|
minetest.show_formspec(p_name, atm_form, tostring(fs))
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2017-06-03 23:40:32 +02:00
|
|
|
local trans_ids = {}
|
|
|
|
|
2016-03-05 11:47:35 +01:00
|
|
|
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
2016-02-25 23:38:19 +01:00
|
|
|
if formname ~= atm_form then return end
|
2016-03-05 11:47:35 +01:00
|
|
|
if fields.quit then return true end
|
2016-02-25 23:38:19 +01:00
|
|
|
|
|
|
|
local p_name = player:get_player_name()
|
|
|
|
|
2017-06-03 23:40:32 +02:00
|
|
|
local this_id = tonumber(fields.trans_id)
|
2016-02-25 23:38:19 +01:00
|
|
|
|
2017-06-03 23:40:32 +02:00
|
|
|
if this_id and trans_ids[p_name] and this_id <= trans_ids[p_name] then
|
|
|
|
-- Ignore duplicate/stale form submittal
|
2016-02-25 23:38:19 +01:00
|
|
|
return true
|
|
|
|
end
|
|
|
|
|
|
|
|
trans_ids[p_name] = this_id
|
|
|
|
|
2016-03-05 11:47:35 +01:00
|
|
|
if fields.logout then
|
2017-06-01 12:14:13 +02:00
|
|
|
show_atm_form(main_menu_fs, p_name)
|
|
|
|
elseif fields.info then
|
|
|
|
show_atm_form(info_fs, p_name)
|
|
|
|
elseif fields.wire then
|
|
|
|
show_atm_form(wire_fs, p_name)
|
2020-01-07 23:04:59 +01:00
|
|
|
elseif fields.withdraw then
|
|
|
|
show_atm_form(withdraw_fs, p_name, fields and fields.w_amount)
|
2017-06-01 12:14:13 +02:00
|
|
|
elseif fields.send then
|
|
|
|
show_atm_form(send_fs, p_name, fields.recipient, fields.amount)
|
|
|
|
elseif fields.transaction_log then
|
|
|
|
show_atm_form(log_fs, p_name)
|
2016-02-27 04:45:32 +01:00
|
|
|
end
|
|
|
|
|
2016-02-25 23:38:19 +01:00
|
|
|
return true
|
2016-03-05 11:47:35 +01:00
|
|
|
end)
|
2016-02-25 23:38:19 +01:00
|
|
|
|
|
|
|
|
2016-05-19 06:16:15 +02:00
|
|
|
minetest.register_node("global_exchange:atm_bottom", {
|
2020-09-11 08:21:51 +02:00
|
|
|
description = "ATM",
|
2016-05-19 06:16:15 +02:00
|
|
|
inventory_image = "global_exchange_atm_icon.png",
|
|
|
|
wield_image = "global_exchange_atm_hi_front.png",
|
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {
|
|
|
|
"global_exchange_atm_lo_top.png",
|
|
|
|
"global_exchange_atm_side.png",
|
|
|
|
"global_exchange_atm_side.png",
|
|
|
|
"global_exchange_atm_side.png",
|
|
|
|
"global_exchange_atm_back.png^[transform2",
|
|
|
|
"global_exchange_atm_lo_front.png",
|
|
|
|
},
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
is_ground_content = false,
|
|
|
|
stack_max = 1,
|
|
|
|
light_source = 3,
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
2017-06-01 12:14:13 +02:00
|
|
|
{-0.500, -0.500, -0.5000, 0.500, 0.500, 0.50},
|
|
|
|
{-0.500, 0.500, -0.5000, -0.375, 1.125, -0.25},
|
|
|
|
{ 0.375, 0.500, -0.5000, 0.500, 1.125, -0.25},
|
|
|
|
{-0.500, 0.500, -0.2500, 0.500, 1.500, 0.50},
|
|
|
|
{-0.500, 1.125, -0.4375, -0.375, 1.250, -0.25},
|
|
|
|
{ 0.375, 1.125, -0.4375, 0.500, 1.250, -0.25},
|
|
|
|
{-0.500, 1.250, -0.3750, -0.375, 1.375, -0.25},
|
|
|
|
{ 0.375, 1.250, -0.3750, 0.500, 1.375, -0.25},
|
|
|
|
{-0.500, 1.375, -0.3125, -0.375, 1.500, -0.25},
|
|
|
|
{ 0.375, 1.375, -0.3125, 0.500, 1.500, -0.25},
|
2016-05-19 06:16:15 +02:00
|
|
|
},
|
2016-02-25 23:38:19 +01:00
|
|
|
},
|
2018-12-31 13:36:52 +01:00
|
|
|
groups = {cracky=2, atm = 1},
|
2016-05-19 06:16:15 +02:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
local under = pointed_thing.under
|
|
|
|
local pos
|
|
|
|
if minetest.registered_items[minetest.get_node(under).name].buildable_to then
|
|
|
|
pos = under
|
|
|
|
else
|
|
|
|
pos = pointed_thing.above
|
|
|
|
end
|
|
|
|
if minetest.is_protected(pos, placer:get_player_name()) and
|
|
|
|
not minetest.check_player_privs(placer, "protection_bypass") then
|
|
|
|
minetest.record_protection_violation(pos, placer:get_player_name())
|
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
local def = minetest.registered_nodes[minetest.get_node(pos).name]
|
|
|
|
if not def or not def.buildable_to then
|
|
|
|
minetest.remove_node(pos)
|
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
local dir = minetest.dir_to_facedir(placer:get_look_dir())
|
|
|
|
local pos2 = {x = pos.x, y = pos.y + 1, z = pos.z}
|
|
|
|
local def2 = minetest.registered_nodes[minetest.get_node(pos2).name]
|
|
|
|
if not def2 or not def2.buildable_to then
|
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
minetest.set_node(pos, {name = "global_exchange:atm_bottom", param2 = dir})
|
|
|
|
minetest.set_node(pos2, {name = "global_exchange:atm_top", param2 = dir})
|
|
|
|
if not minetest.setting_getbool("creative_mode") then
|
|
|
|
itemstack:take_item()
|
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
end,
|
2020-01-07 23:04:59 +01:00
|
|
|
can_dig = function(pos,player)
|
|
|
|
local meta = minetest.get_meta(pos);
|
|
|
|
local inv = meta:get_inventory()
|
|
|
|
return inv:is_empty("main")
|
|
|
|
end,
|
2016-05-19 06:16:15 +02:00
|
|
|
on_destruct = function(pos)
|
|
|
|
local pos2 = {x = pos.x, y = pos.y + 1, z = pos.z}
|
|
|
|
local n2 = minetest.get_node(pos2)
|
|
|
|
if minetest.get_item_group(n2.name, "atm") == 2 then
|
|
|
|
minetest.remove_node(pos2)
|
|
|
|
end
|
|
|
|
end,
|
2018-12-31 13:36:52 +01:00
|
|
|
on_construct = function(pos)
|
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
meta:set_string("infotext", "ATM")
|
|
|
|
local inv = meta:get_inventory()
|
2020-01-07 23:04:59 +01:00
|
|
|
inv:set_size("main", 6)
|
2018-12-31 13:36:52 +01:00
|
|
|
end,
|
|
|
|
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
|
|
|
local itname = stack:get_name()
|
|
|
|
if coins_convert[itname] ~= nil then
|
|
|
|
return stack:get_count()
|
|
|
|
end
|
|
|
|
return 0
|
|
|
|
end,
|
2020-01-07 23:04:59 +01:00
|
|
|
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
|
|
|
return stack:get_count()
|
|
|
|
end,
|
2018-12-31 13:36:52 +01:00
|
|
|
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
|
|
|
local itname = stack:get_name()
|
|
|
|
if coins_convert[itname] ~= nil then
|
|
|
|
local p_name = player:get_player_name()
|
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
local inv = meta:get_inventory()
|
|
|
|
local nb = stack:get_count()
|
|
|
|
local amount = coins_convert[itname] * nb
|
2020-09-11 08:21:51 +02:00
|
|
|
local succ, msg = exchange:give_credits(p_name, amount, S("Cash deposit (+@1)", amount))
|
2018-12-31 13:36:52 +01:00
|
|
|
if succ then
|
|
|
|
inv:set_stack(listname, index, nil)
|
|
|
|
minetest.log("action", p_name.." put "..nb.." "..stack:get_name() .. " to ATM at " .. minetest.pos_to_string(pos))
|
2020-01-07 23:04:59 +01:00
|
|
|
show_atm_form(withdraw_fs, p_name)
|
2019-03-08 23:46:27 +01:00
|
|
|
--minetest.show_formspec(p_name, atm_form, deposit_fs(p_name))
|
2018-12-31 13:36:52 +01:00
|
|
|
else
|
|
|
|
minetest.log("error", p_name.." want to put "..nb.." "..stack:get_name().." to ATM at ".. minetest.pos_to_string(pos).." but: "..msg)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end,
|
2020-01-07 23:04:59 +01:00
|
|
|
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
|
|
|
minetest.log("action", player:get_player_name().." take "..stack:get_count().." "..stack:get_name().." from ATM at "..minetest.pos_to_string(pos))
|
|
|
|
end,
|
2016-03-05 11:47:35 +01:00
|
|
|
on_rightclick = function(pos, _, clicker)
|
2018-12-31 13:36:52 +01:00
|
|
|
local p_name = clicker:get_player_name()
|
|
|
|
atm_pos[p_name] = pos
|
2016-05-21 02:48:43 +02:00
|
|
|
minetest.sound_play("atm_beep", {pos = pos, gain = 0.3, max_hear_distance = 5})
|
2017-06-01 12:14:13 +02:00
|
|
|
show_atm_form(main_menu_fs, clicker:get_player_name())
|
2016-02-25 23:38:19 +01:00
|
|
|
end,
|
|
|
|
})
|
2016-02-27 05:55:48 +01:00
|
|
|
|
2016-05-19 06:16:15 +02:00
|
|
|
minetest.register_node("global_exchange:atm_top", {
|
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {
|
|
|
|
"global_exchange_atm_hi_top.png",
|
|
|
|
"global_exchange_atm_side.png",--not visible anyway
|
|
|
|
"global_exchange_atm_side.png",
|
|
|
|
"global_exchange_atm_side.png",
|
|
|
|
"global_exchange_atm_back.png",
|
|
|
|
"global_exchange_atm_hi_front.png",
|
|
|
|
},
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
is_ground_content = false,
|
|
|
|
light_source = 3,
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
2017-06-01 12:14:13 +02:00
|
|
|
{-0.500, -0.500, -0.5000, -0.375, 0.125, -0.25},
|
|
|
|
{ 0.375, -0.500, -0.5000, 0.500, 0.125, -0.25},
|
|
|
|
{-0.500, -0.500, -0.2500, 0.500, 0.500, 0.50},
|
|
|
|
{-0.500, 0.125, -0.4375, -0.375, 0.250, -0.25},
|
|
|
|
{ 0.375, 0.125, -0.4375, 0.500, 0.250, -0.25},
|
|
|
|
{-0.500, 0.250, -0.3750, -0.375, 0.375, -0.25},
|
|
|
|
{ 0.375, 0.250, -0.3750, 0.500, 0.375, -0.25},
|
|
|
|
{-0.500, 0.375, -0.3125, -0.375, 0.500, -0.25},
|
|
|
|
{ 0.375, 0.375, -0.3125, 0.500, 0.500, -0.25},
|
2016-05-19 06:16:15 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {0, 0, 0, 0, 0, 0},
|
|
|
|
},
|
|
|
|
groups = {
|
|
|
|
atm = 2,
|
|
|
|
not_in_creative_inventory = 1
|
|
|
|
},
|
|
|
|
})
|
2016-02-27 05:55:48 +01:00
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
output = "global_exchange:atm",
|
|
|
|
recipe = {
|
2017-06-01 12:14:13 +02:00
|
|
|
{ "default:stone", "default:stone", "default:stone" },
|
2016-02-27 05:55:48 +01:00
|
|
|
{ "default:stone", "default:gold_ingot", "default:stone" },
|
2017-06-01 12:14:13 +02:00
|
|
|
{ "default:stone", "default:stone", "default:stone" },
|
2016-02-27 05:55:48 +01:00
|
|
|
}
|
|
|
|
})
|
2016-05-19 06:16:15 +02:00
|
|
|
|
|
|
|
minetest.register_alias("global_exchange:atm", "global_exchange:atm_bottom")
|
2017-06-01 12:14:13 +02:00
|
|
|
-- vim:set ts=4 sw=4 noet:
|