From 807754a6e86b397e60adf6a35debfac09ae56e40 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Wed, 8 Jan 2014 17:02:04 +0100 Subject: [PATCH] Upload --- HELP_ME.txt | 24 ++ bank_currency.lua | 218 ++++++++++++ bank_money.lua | 200 +++++++++++ bank_money2.lua | 200 +++++++++++ config.default.txt | 27 ++ depends.txt | 7 + init.lua | 32 ++ minecoins.lua | 133 ++++++++ moneychanger.lua | 193 +++++++++++ moreores.lua | 126 +++++++ shop.lua | 314 ++++++++++++++++++ textures/16px/bitchange_bank_front.png | Bin 0 -> 522 bytes textures/16px/bitchange_bank_side.png | Bin 0 -> 343 bytes textures/16px/bitchange_minecoin.png | Bin 0 -> 363 bytes textures/16px/bitchange_mineninth.png | Bin 0 -> 334 bytes .../16px/bitchange_moneychanger_front.png | Bin 0 -> 456 bytes textures/16px/bitchange_moneychanger_side.png | Bin 0 -> 282 bytes textures/16px/bitchange_moneychanger_top.png | Bin 0 -> 361 bytes textures/16px/bitchange_shop_front.png | Bin 0 -> 822 bytes textures/16px/bitchange_shop_side.png | Bin 0 -> 755 bytes textures/16px/bitchange_shop_top.png | Bin 0 -> 734 bytes textures/16px/bitchange_warehouse_front.png | Bin 0 -> 485 bytes textures/16px/bitchange_warehouse_side.png | Bin 0 -> 444 bytes textures/16px/bitchange_warehouse_top.png | Bin 0 -> 441 bytes textures/bitchange_bank_front.png | Bin 0 -> 988 bytes textures/bitchange_bank_side.png | Bin 0 -> 619 bytes textures/bitchange_coinbase.png | Bin 0 -> 482 bytes textures/bitchange_minecoin.png | Bin 0 -> 1178 bytes textures/bitchange_minecoin_in_ground.png | Bin 0 -> 366 bytes textures/bitchange_minecoinblock.png | Bin 0 -> 404 bytes textures/bitchange_mineninth.png | Bin 0 -> 1146 bytes textures/bitchange_mineninth_in_ground.png | Bin 0 -> 364 bytes textures/bitchange_moneychanger_front.png | Bin 0 -> 1321 bytes textures/bitchange_moneychanger_side.png | Bin 0 -> 320 bytes textures/bitchange_moneychanger_top.png | Bin 0 -> 1291 bytes textures/bitchange_shop_front.png | Bin 0 -> 2735 bytes textures/bitchange_shop_side.png | Bin 0 -> 2837 bytes textures/bitchange_shop_top.png | Bin 0 -> 2997 bytes textures/bitchange_warehouse_front.png | Bin 0 -> 903 bytes textures/bitchange_warehouse_side.png | Bin 0 -> 957 bytes textures/bitchange_warehouse_top.png | Bin 0 -> 1406 bytes textures/moreores_mineral_tin.png | Bin 0 -> 254 bytes textures/moreores_tin_block.png | Bin 0 -> 269 bytes textures/moreores_tin_ingot.png | Bin 0 -> 361 bytes textures/moreores_tin_lump.png | Bin 0 -> 361 bytes textures/technic_mineral_zinc.png | Bin 0 -> 891 bytes textures/technic_zinc_block.png | Bin 0 -> 681 bytes textures/technic_zinc_ingot.png | Bin 0 -> 317 bytes textures/technic_zinc_lump.png | Bin 0 -> 308 bytes version.txt | 73 ++++ warehouse.lua | 148 +++++++++ 51 files changed, 1695 insertions(+) create mode 100644 HELP_ME.txt create mode 100644 bank_currency.lua create mode 100644 bank_money.lua create mode 100644 bank_money2.lua create mode 100644 config.default.txt create mode 100644 depends.txt create mode 100644 init.lua create mode 100644 minecoins.lua create mode 100644 moneychanger.lua create mode 100644 moreores.lua create mode 100644 shop.lua create mode 100644 textures/16px/bitchange_bank_front.png create mode 100644 textures/16px/bitchange_bank_side.png create mode 100644 textures/16px/bitchange_minecoin.png create mode 100644 textures/16px/bitchange_mineninth.png create mode 100644 textures/16px/bitchange_moneychanger_front.png create mode 100644 textures/16px/bitchange_moneychanger_side.png create mode 100644 textures/16px/bitchange_moneychanger_top.png create mode 100644 textures/16px/bitchange_shop_front.png create mode 100644 textures/16px/bitchange_shop_side.png create mode 100644 textures/16px/bitchange_shop_top.png create mode 100644 textures/16px/bitchange_warehouse_front.png create mode 100644 textures/16px/bitchange_warehouse_side.png create mode 100644 textures/16px/bitchange_warehouse_top.png create mode 100644 textures/bitchange_bank_front.png create mode 100644 textures/bitchange_bank_side.png create mode 100644 textures/bitchange_coinbase.png create mode 100644 textures/bitchange_minecoin.png create mode 100644 textures/bitchange_minecoin_in_ground.png create mode 100644 textures/bitchange_minecoinblock.png create mode 100644 textures/bitchange_mineninth.png create mode 100644 textures/bitchange_mineninth_in_ground.png create mode 100644 textures/bitchange_moneychanger_front.png create mode 100644 textures/bitchange_moneychanger_side.png create mode 100644 textures/bitchange_moneychanger_top.png create mode 100644 textures/bitchange_shop_front.png create mode 100644 textures/bitchange_shop_side.png create mode 100644 textures/bitchange_shop_top.png create mode 100644 textures/bitchange_warehouse_front.png create mode 100644 textures/bitchange_warehouse_side.png create mode 100644 textures/bitchange_warehouse_top.png create mode 100644 textures/moreores_mineral_tin.png create mode 100644 textures/moreores_tin_block.png create mode 100644 textures/moreores_tin_ingot.png create mode 100644 textures/moreores_tin_lump.png create mode 100644 textures/technic_mineral_zinc.png create mode 100644 textures/technic_zinc_block.png create mode 100644 textures/technic_zinc_ingot.png create mode 100644 textures/technic_zinc_lump.png create mode 100644 version.txt create mode 100644 warehouse.lua diff --git a/HELP_ME.txt b/HELP_ME.txt new file mode 100644 index 0000000..f0bf3c6 --- /dev/null +++ b/HELP_ME.txt @@ -0,0 +1,24 @@ +==> How to enable ... + -> Open 'config.txt' with your editor and modify it + +==> Add special access to nodes, how? + -> Exchange shop: open 'shop.lua' and edit the function 'has_exchange_shop_privilege', + return 'true' to grant access to the contents, return 'false' to disallow + -> Warehouse: same like exchange shop, this time 'warehouse.lua' and 'has_locked_chest_privilege' + +==> Can I ... + -> Suggest things: Sure, I'm happy about (almost) every suggestion, just I'm pretty new, which + means I can't realize all of them + -> Report a fault: I hope this will not happen too much, post it at the topic in the MT forums + -> Edit the files: Yes sure, the license is 'WTFPL' but I'm always happy about credits :smile: + -> Delete this mod: Stupid question + -> Exchange textures: Yes, it's WFTPL! Maybe you need to ask the original creator of the images + +==> Give me informations about the converting! +Burning: + 1 Gold block -> 2 MineCoin block + 2 MineCoin block -> 1 Gold block + 1 Coin base -> 1 MineNinth +Crafting: + 1 Zinc block -> 8 Coin base + 1 Tin block -> 20 Coin base \ No newline at end of file diff --git a/bank_currency.lua b/bank_currency.lua new file mode 100644 index 0000000..f3e8885 --- /dev/null +++ b/bank_currency.lua @@ -0,0 +1,218 @@ +--Created by Krock for the BitChange mod +-- Bank node for the mod: currency (by Dan Duncombe) +--License: WTFPL + +local file_path = minetest.get_worldpath() .. "/bitchange_bank_currency" +local exchange_worth = 15 -- default worth in "money" for one MineCoin, change if not okay +local bank = {} +local changes_made = false + +local fs_1 = io.open(file_path, "r") +if fs_1 then + exchange_worth = tonumber(fs_1:read("*l")) + io.close(fs_1) +end + +local function round(num, idp) + if idp and idp>0 then + local mult = 10^idp + return math.floor(num * mult + 0.5) / mult + end + return math.floor(num + 0.5) +end + +local function save_exchange_rate() + local fs_2 = io.open(file_path, "w") + fs_2:write(tostring(exchange_worth)) + io.close(fs_2) +end + +local ttime = 0 +minetest.register_globalstep(function(t) + ttime = ttime + t + if ttime < 240 then --every 4min' + return + end + if(changes_made) then + save_exchange_rate() + end + ttime = 0 +end) + +minetest.register_on_shutdown(function() + save_exchange_rate() +end) + +local function has_bank_privilege(meta, player) + local player_name = player:get_player_name() + return ((player_name == meta:get_string("owner")) or minetest.get_player_privs(player_name).server) +end + +local function get_bank_formspec(number, pos) + local formspec = "" + local name = "nodemeta:"..pos.x..","..pos.y..","..pos.z + if(number == 1) then + -- customer + formspec = ("size[8,8]".. + "label[0,0;Bank]".. + "label[2,0;(View reserve with (E) + (Right click))]".. + "label[1,1;Current worth of a MineCoin:]".. + "label[3,1.5;~ "..round(exchange_worth, 2).." MineGeld]".. + "button[2,3;3,1;sell10;Buy 10 MineCoins]".. + "button[2,2;3,1;buy10;Sell 10 MineCoins]".. + "list[current_player;main;0,4;8,4;]") + elseif(number == 2) then + -- owner + formspec = ("size[8,9;]".. + "label[0,0;Bank]".. + "label[1,0.5;Current MineCoin reserve: (Editable by owner)]".. + "list["..name..";coins;0,1;8,3;]".. + "list[current_player;main;0,5;8,4;]") + end + return formspec +end + +minetest.register_on_player_receive_fields(function(sender, formname, fields) + if(formname == "bitchange:bank_formspec") then + local player_name = sender:get_player_name() + if(fields.quit) then + bank[player_name] = nil + return + end + if(exchange_worth < 1) then + exchange_worth = 1 + end + local pos = bank[player_name] + local bank_inv = minetest.get_meta(pos):get_inventory() + local player_inv = sender:get_inventory() + local coin_stack = "bitchange:minecoin 10" + local geld_stack = "currency:minegeld " + local err_msg = "" + if(fields.buy10) then + geld_stack = geld_stack..(round(exchange_worth * 0.995, 1) * 10) + if(not player_inv:contains_item("main", coin_stack)) then + err_msg = "You do not have the needed MineCoins." + end + if(err_msg == "") then + if(not bank_inv:room_for_item("coins", coin_stack)) then + err_msg = "This bank has no space to buy more MineCoins." + end + end + if(err_msg == "") then + if(not bank_inv:contains_item("coins", geld_stack)) then + err_msg = "This bank has no MineGeld ready to sell." + end + end + if(err_msg == "") then + if(not player_inv:room_for_item("main", geld_stack)) then + err_msg = "You do not have enough space in your inventory." + end + end + if(err_msg == "") then + exchange_worth = exchange_worth * 0.995 + local price = round(exchange_worth - 0.01, 1) * 10 + bank_inv:remove_item("coins", geld_stack) + player_inv:add_item("main", geld_stack) + player_inv:remove_item("main", coin_stack) + bank_inv:add_item("coins", coin_stack) + changes_made = true + err_msg = "Sold 10 MineCoins for "..price.." MineGeld" + end + elseif(fields.sell10) then + local price = round(exchange_worth, 1) * 10 + geld_stack = geld_stack..(round(exchange_worth, 1) * 10) + if(not player_inv:contains_item("main", geld_stack)) then + err_msg = "You do not have the required money. ("..price.." x 1 MineGeld pieces)" + end + if(err_msg == "") then + if(not bank_inv:room_for_item("coins", geld_stack)) then + err_msg = "This bank has no space to buy more MineGeld." + end + end + if(err_msg == "") then + if(not bank_inv:contains_item("coins", coin_stack)) then + err_msg = "This bank has no MineCoins ready to sell." + end + end + if(err_msg == "") then + if(not player_inv:room_for_item("main", coin_stack)) then + err_msg = "You do not have enough space in your inventory." + end + end + if(err_msg == "") then + player_inv:remove_item("main", geld_stack) + bank_inv:add_item("coins", geld_stack) + bank_inv:remove_item("coins", coin_stack) + player_inv:add_item("main", coin_stack) + exchange_worth = exchange_worth * 1.005 + changes_made = true + err_msg = "Bought 10 MineCoins for "..price.." MineGeld" + end + end + if(err_msg ~= "") then + minetest.chat_send_player(player_name, "Bank: "..err_msg) + end + end +end) + +minetest.register_node("bitchange:bank", { + description = "Bank", + tiles = {"bitchange_bank_side.png", "bitchange_bank_side.png", + "bitchange_bank_side.png", "bitchange_bank_side.png", + "bitchange_bank_side.png", "bitchange_bank_front.png"}, + paramtype2 = "facedir", + groups = {cracky=1,level=1}, + sounds = default.node_sound_stone_defaults(), + after_place_node = function(pos, placer) + local meta = minetest.get_meta(pos) + meta:set_string("owner", placer:get_player_name()) + meta:set_string("infotext", "Bank (owned by ".. + meta:get_string("owner")..")") + end, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", "Bank (constructing)") + meta:set_string("formspec", "") + meta:set_string("owner", "") + local inv = meta:get_inventory() + inv:set_size("coins", 8*3) + end, + can_dig = function(pos,player) + local meta = minetest.get_meta(pos) + if(meta:get_string("owner") == player:get_player_name()) then + return meta:get_inventory():is_empty("coins") + else + return false + end + end, + on_rightclick = function(pos, node, clicker, itemstack) + local player_name = clicker:get_player_name() + local view = 1 + bank[player_name] = pos + if(clicker:get_player_control().aux1) then + view = 2 + end + minetest.show_formspec(player_name,"bitchange:bank_formspec",get_bank_formspec(view, pos)) + end, + allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + local meta = minetest.get_meta(pos) + if(has_bank_privilege(meta, player)) then + return count + end + return 0 + end, + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + if (has_bank_privilege(meta, player)) then + return stack:get_count() + end + return 0 + end, + allow_metadata_inventory_take = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + if (has_bank_privilege(meta, player)) then + return stack:get_count() + end + return 0 + end, +}) \ No newline at end of file diff --git a/bank_money.lua b/bank_money.lua new file mode 100644 index 0000000..9e147c3 --- /dev/null +++ b/bank_money.lua @@ -0,0 +1,200 @@ +--Created by Krock for the BitChange mod +-- Bank node for the mod: money (by kotolegokot) +--License: WTFPL + +local file_path = minetest.get_worldpath() .. "/bitchange_bank_money" +local exchange_worth = 100.0 -- default worth in "money" for one MineCoin, change if not okay +local bank = {} +local changes_made = false + +local fs_1 = io.open(file_path, "r") +if fs_1 then + exchange_worth = tonumber(fs_1:read("*l")) + io.close(fs_1) +end + +local function round(num, idp) + if idp and idp>0 then + local mult = 10^idp + return math.floor(num * mult + 0.5) / mult + end + return math.floor(num + 0.5) +end + +local function save_exchange_rate() + local fs_2 = io.open(file_path, "w") + fs_2:write(tostring(exchange_worth)) + io.close(fs_2) +end + +local ttime = 0 +minetest.register_globalstep(function(t) + ttime = ttime + t + if ttime < 240 then --every 4min' + return + end + if(changes_made) then + save_exchange_rate() + end + ttime = 0 +end) + +minetest.register_on_shutdown(function() + save_exchange_rate() +end) + +local function has_bank_privilege(meta, player) + local player_name = player:get_player_name() + return ((player_name == meta:get_string("owner")) or minetest.get_player_privs(player_name).server) +end + +local function get_bank_formspec(number, pos) + local formspec = "" + local name = "nodemeta:"..pos.x..","..pos.y..","..pos.z + if(number == 1) then + -- customer + formspec = ("size[8,8]".. + "label[0,0;Bank]".. + "label[2,0;(View reserve with (E) + (Right click))]".. + "label[1,1;Current worth of a MineCoin:]".. + "label[3,1.5;~ "..round(exchange_worth, 4).." money]".. + "button[2,3;3,1;sell10;Buy 10 MineCoins]".. + "button[2,2;3,1;buy10;Sell 10 MineCoins]".. + "list[current_player;main;0,4;8,4;]") + elseif(number == 2) then + -- owner + formspec = ("size[8,9;]".. + "label[0,0;Bank]".. + "label[1,0.5;Current MineCoin reserve: (Editable by owner)]".. + "list["..name..";coins;0,1;8,3;]".. + "list[current_player;main;0,5;8,4;]") + end + return formspec +end + +minetest.register_on_player_receive_fields(function(sender, formname, fields) + if(formname == "bitchange:bank_formspec") then + local player_name = sender:get_player_name() + if(fields.quit) then + bank[player_name] = nil + return + end + if(exchange_worth < 1) then + exchange_worth = 1 + end + local pos = bank[player_name] + local bank_inv = minetest.get_meta(pos):get_inventory() + local player_inv = sender:get_inventory() + local coin_stack = "bitchange:minecoin 10" + local err_msg = "" + if(fields.buy10) then + if(not player_inv:contains_item("main", coin_stack)) then + err_msg = "You do not have the needed MineCoins." + end + if(err_msg == "") then + if(not bank_inv:room_for_item("coins", coin_stack)) then + err_msg = "This bank has no space to buy more MineCoins." + end + end + if(err_msg == "") then + exchange_worth = exchange_worth * 0.995 + local price = round(exchange_worth - 0.1, 1) * 10 + local cur_money = money.get_money(player_name) + money.set_money(player_name, cur_money + price) + player_inv:remove_item("main", coin_stack) + bank_inv:add_item("coins", coin_stack) + changes_made = true + err_msg = "Sold 10 MineCoins for "..price.." money" + end + elseif(fields.sell10) then + local price = round(exchange_worth, 1) * 10 + local cur_money = money.get_money(player_name) + if(cur_money < price) then + err_msg = "You do not have the required money. ("..price.." money)" + end + if(err_msg == "") then + if(not bank_inv:contains_item("coins", coin_stack)) then + err_msg = "This bank has no MineCoins ready to sell." + end + end + if(err_msg == "") then + if(not player_inv:room_for_item("main", coin_stack)) then + err_msg = "You do not have enough space in your inventory." + end + end + if(err_msg == "") then + money.set_money(player_name, cur_money - price) + bank_inv:remove_item("coins", coin_stack) + player_inv:add_item("main", coin_stack) + exchange_worth = exchange_worth * 1.005 + changes_made = true + err_msg = "Bought 10 MineCoins for "..price.." money" + end + end + if(err_msg ~= "") then + minetest.chat_send_player(player_name, "Bank: "..err_msg) + end + end +end) + +minetest.register_node("bitchange:bank", { + description = "Bank", + tiles = {"bitchange_bank_side.png", "bitchange_bank_side.png", + "bitchange_bank_side.png", "bitchange_bank_side.png", + "bitchange_bank_side.png", "bitchange_bank_front.png"}, + paramtype2 = "facedir", + groups = {cracky=1,level=1}, + sounds = default.node_sound_stone_defaults(), + after_place_node = function(pos, placer) + local meta = minetest.get_meta(pos) + meta:set_string("owner", placer:get_player_name()) + meta:set_string("infotext", "Bank (owned by ".. + meta:get_string("owner")..")") + end, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", "Bank (constructing)") + meta:set_string("formspec", "") + meta:set_string("owner", "") + local inv = meta:get_inventory() + inv:set_size("coins", 8*3) + end, + can_dig = function(pos,player) + local meta = minetest.get_meta(pos) + if(meta:get_string("owner") == player:get_player_name()) then + return meta:get_inventory():is_empty("coins") + else + return false + end + end, + on_rightclick = function(pos, node, clicker, itemstack) + local player_name = clicker:get_player_name() + local view = 1 + bank[player_name] = pos + if(clicker:get_player_control().aux1) then + view = 2 + end + minetest.show_formspec(player_name,"bitchange:bank_formspec",get_bank_formspec(view, pos)) + end, + allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + local meta = minetest.get_meta(pos) + if(has_bank_privilege(meta, player)) then + return count + end + return 0 + end, + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + if (has_bank_privilege(meta, player)) then + return stack:get_count() + end + return 0 + end, + allow_metadata_inventory_take = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + if (has_bank_privilege(meta, player)) then + return stack:get_count() + end + return 0 + end, +}) \ No newline at end of file diff --git a/bank_money2.lua b/bank_money2.lua new file mode 100644 index 0000000..10c5190 --- /dev/null +++ b/bank_money2.lua @@ -0,0 +1,200 @@ +--Created by Krock for the BitChange mod +-- Bank node for the mod: money2 (by Bad Command) +--License: WTFPL + +local file_path = minetest.get_worldpath() .. "/bitchange_bank_money2" +local exchange_worth = 100.0 -- default worth in "cr" for one MineCoin, change if not okay +local bank = {} +local changes_made = false + +local fs_1 = io.open(file_path, "r") +if fs_1 then + exchange_worth = tonumber(fs_1:read("*l")) + io.close(fs_1) +end + +local function round(num, idp) + if idp and idp>0 then + local mult = 10^idp + return math.floor(num * mult + 0.5) / mult + end + return math.floor(num + 0.5) +end + +local function save_exchange_rate() + local fs_2 = io.open(file_path, "w") + fs_2:write(tostring(exchange_worth)) + io.close(fs_2) +end + +local ttime = 0 +minetest.register_globalstep(function(t) + ttime = ttime + t + if ttime < 240 then --every 4min' + return + end + if(changes_made) then + save_exchange_rate() + end + ttime = 0 +end) + +minetest.register_on_shutdown(function() + save_exchange_rate() +end) + +local function has_bank_privilege(meta, player) + local player_name = player:get_player_name() + return ((player_name == meta:get_string("owner")) or minetest.get_player_privs(player_name).server) +end + +local function get_bank_formspec(number, pos) + local formspec = "" + local name = "nodemeta:"..pos.x..","..pos.y..","..pos.z + if(number == 1) then + -- customer + formspec = ("size[8,8]".. + "label[0,0;Bank]".. + "label[2,0;(View reserve with (E) + (Right click))]".. + "label[1,1;Current worth of a MineCoin:]".. + "label[3,1.5;~ "..round(exchange_worth, 4).." cr]".. + "button[2,3;3,1;sell10;Buy 10 MineCoins]".. + "button[2,2;3,1;buy10;Sell 10 MineCoins]".. + "list[current_player;main;0,4;8,4;]") + elseif(number == 2) then + -- owner + formspec = ("size[8,9;]".. + "label[0,0;Bank]".. + "label[1,0.5;Current MineCoin reserve: (Editable by owner)]".. + "list["..name..";coins;0,1;8,3;]".. + "list[current_player;main;0,5;8,4;]") + end + return formspec +end + +minetest.register_on_player_receive_fields(function(sender, formname, fields) + if(formname == "bitchange:bank_formspec") then + local player_name = sender:get_player_name() + if(fields.quit) then + bank[player_name] = nil + return + end + if(exchange_worth < 1) then + exchange_worth = 1 + end + local pos = bank[player_name] + local bank_inv = minetest.get_meta(pos):get_inventory() + local player_inv = sender:get_inventory() + local coin_stack = "bitchange:minecoin 10" + local err_msg = "" + if(fields.buy10) then + if(not player_inv:contains_item("main", coin_stack)) then + err_msg = "You do not have the needed MineCoins." + end + if(err_msg == "") then + if(not bank_inv:room_for_item("coins", coin_stack)) then + err_msg = "This bank has no space to buy more MineCoins." + end + end + if(err_msg == "") then + exchange_worth = exchange_worth * 0.995 + local price = round(exchange_worth - 0.1, 1) * 10 + local cur_money = money.get(player_name, amount) + money.set(player_name, cur_money + price) + player_inv:remove_item("main", coin_stack) + bank_inv:add_item("coins", coin_stack) + changes_made = true + err_msg = "Sold 10 MineCoins for "..price.." cr" + end + elseif(fields.sell10) then + local price = round(exchange_worth, 1) * 10 + local cur_money = money.get(player_name) + if(cur_money < price) then + err_msg = "You do not have the required money. ("..price.." cr)" + end + if(err_msg == "") then + if(not bank_inv:contains_item("coins", coin_stack)) then + err_msg = "This bank has no MineCoins ready to sell." + end + end + if(err_msg == "") then + if(not player_inv:room_for_item("main", coin_stack)) then + err_msg = "You do not have enough space in your inventory." + end + end + if(err_msg == "") then + money.set(player_name, cur_money - price) + bank_inv:remove_item("coins", coin_stack) + player_inv:add_item("main", coin_stack) + exchange_worth = exchange_worth * 1.005 + changes_made = true + err_msg = "Bought 10 MineCoins for "..price.." cr" + end + end + if(err_msg ~= "") then + minetest.chat_send_player(player_name, "Bank: "..err_msg) + end + end +end) + +minetest.register_node("bitchange:bank", { + description = "Bank", + tiles = {"bitchange_bank_side.png", "bitchange_bank_side.png", + "bitchange_bank_side.png", "bitchange_bank_side.png", + "bitchange_bank_side.png", "bitchange_bank_front.png"}, + paramtype2 = "facedir", + groups = {cracky=1,level=1}, + sounds = default.node_sound_stone_defaults(), + after_place_node = function(pos, placer) + local meta = minetest.get_meta(pos) + meta:set_string("owner", placer:get_player_name()) + meta:set_string("infotext", "Bank (owned by ".. + meta:get_string("owner")..")") + end, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", "Bank (constructing)") + meta:set_string("formspec", "") + meta:set_string("owner", "") + local inv = meta:get_inventory() + inv:set_size("coins", 8*3) + end, + can_dig = function(pos,player) + local meta = minetest.get_meta(pos) + if(meta:get_string("owner") == player:get_player_name()) then + return meta:get_inventory():is_empty("coins") + else + return false + end + end, + on_rightclick = function(pos, node, clicker, itemstack) + local player_name = clicker:get_player_name() + local view = 1 + bank[player_name] = pos + if(clicker:get_player_control().aux1) then + view = 2 + end + minetest.show_formspec(player_name,"bitchange:bank_formspec",get_bank_formspec(view, pos)) + end, + allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + local meta = minetest.get_meta(pos) + if(has_bank_privilege(meta, player)) then + return count + end + return 0 + end, + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + if (has_bank_privilege(meta, player)) then + return stack:get_count() + end + return 0 + end, + allow_metadata_inventory_take = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + if (has_bank_privilege(meta, player)) then + return stack:get_count() + end + return 0 + end, +}) \ No newline at end of file diff --git a/config.default.txt b/config.default.txt new file mode 100644 index 0000000..4f294dc --- /dev/null +++ b/config.default.txt @@ -0,0 +1,27 @@ +-- General configuration - BitChange +-- Created by Krock + +bitchange_initial_give = 2 +-- Enable/Disable whole nodes +bitchange_enable_exchangeshop = true +bitchange_enable_moneychanger = true +bitchange_enable_warehouse = false + +-- Set this variable to the modname of the other currency mod. +-- Let it empty if no other currency is installed. +-- Supported: money (by kotolegokot), money2 (by Bad Command), currency (by Dan Duncombe) +bitchange_bank_type = "" + +-- Tin converting/generation +bitchange_use_moreores_tin = false -- Activate using +bitchange_need_generate_tin = false -- Generate only if needed +-- Zinc converting/generation +bitchange_use_technic_zinc = false -- Activate using +bitchange_need_generate_zinc = false -- Generate only if needed + +-- Pipeworks support +bitchange_exchangeshop_pipeworks = false +bitchange_warehouse_pipeworks = false + +-- Advanced generation settings +-- Change in 'minecoins.lua', starting at line 101 \ No newline at end of file diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..f5772c4 --- /dev/null +++ b/depends.txt @@ -0,0 +1,7 @@ +default +moreores? +technic? +pipeworks? +money? +money2? +currency? \ No newline at end of file diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..08e1410 --- /dev/null +++ b/init.lua @@ -0,0 +1,32 @@ +--Created by Krock for the BitChange mod +local mod_path = minetest.get_modpath("bitchange") + +dofile(mod_path.."/config.txt") +dofile(mod_path.."/minecoins.lua") +if(bitchange_use_moreores_tin or bitchange_use_technic_zinc or bitchange_use_gold) then + dofile(mod_path.."/moreores.lua") +end +if(bitchange_enable_exchangeshop) then + dofile(mod_path.."/shop.lua") +end +if(bitchange_enable_moneychanger) then + dofile(mod_path.."/moneychanger.lua") +end +if(bitchange_enable_warehouse) then + dofile(mod_path.."/warehouse.lua") +end +if(bitchange_bank_type ~= "") then + if(minetest.get_modpath(bitchange_bank_type) ~= nil) then + dofile(mod_path.."/bank_"..bitchange_bank_type..".lua") + else + print("[BitChange] Bank: Type or mod not found or enabled: "..bitchange_bank_type) + end +end + +if(not minetest.setting_getbool("creative_mode") and bitchange_initial_give > 0) then + -- Giving initial money + minetest.register_on_newplayer(function(player) + player:get_inventory():add_item("main", "bitchange:mineninth "..bitchange_initial_give) + end) +end +print("[BitChange] Loaded.") \ No newline at end of file diff --git a/minecoins.lua b/minecoins.lua new file mode 100644 index 0000000..afcada7 --- /dev/null +++ b/minecoins.lua @@ -0,0 +1,133 @@ +--bitcoins by MilesDyson@DistroGeeks.com +--Modified by Krock +--License: WTFPL + +-- Node definitions +minetest.register_node("bitchange:minecoin_in_ground", { + description = "MineCoin Ore", + tile_images = { "default_stone.png^bitchange_minecoin_in_ground.png" }, + is_ground_content = true, + groups = {cracky=2}, + sounds = default.node_sound_stone_defaults(), + drop = 'bitchange:minecoin', +}) + +minetest.register_node("bitchange:mineninth_in_ground", { + description = "MineNinth Ore", + tile_images = { "default_stone.png^bitchange_mineninth_in_ground.png" }, + is_ground_content = true, + groups = {cracky=3}, + sounds = default.node_sound_stone_defaults(), + drop = 'bitchange:coinbase', +}) + +minetest.register_node("bitchange:minecoinblock", { + description = "MineCoin Block", + tile_images = { "bitchange_minecoinblock.png" }, + is_ground_content = true, + groups = {cracky=2}, + sounds = default.node_sound_stone_defaults(), + stack_max = 30000, +}) + +minetest.register_craftitem("bitchange:minecoin", { + description = "MineCoin", + inventory_image = "bitchange_minecoin.png", + stack_max = 30000, +}) + +minetest.register_craftitem("bitchange:mineninth", { + description = "MineNinth", + inventory_image = "bitchange_mineninth.png", + stack_max = 30000, +}) + +minetest.register_craftitem("bitchange:coinbase", { + description = "Coin base", + inventory_image = "bitchange_coinbase.png", +}) + +-- Crafting +minetest.register_craft({ + output = 'bitchange:minecoinblock', + recipe = { + {'bitchange:minecoin', 'bitchange:minecoin', 'bitchange:minecoin'}, + {'bitchange:minecoin', 'bitchange:minecoin', 'bitchange:minecoin'}, + {'bitchange:minecoin', 'bitchange:minecoin', 'bitchange:minecoin'}, + } +}) + +minetest.register_craft({ + output = 'bitchange:minecoin 9', + recipe = { + {'bitchange:minecoinblock'}, + } +}) + +minetest.register_craft({ + output = 'bitchange:minecoin', + recipe = { + {'bitchange:mineninth', 'bitchange:mineninth', 'bitchange:mineninth'}, + {'bitchange:mineninth', 'bitchange:mineninth', 'bitchange:mineninth'}, + {'bitchange:mineninth', 'bitchange:mineninth', 'bitchange:mineninth'}, + } +}) + +minetest.register_craft({ + output = 'bitchange:mineninth 9', + recipe = { + {'bitchange:minecoin'}, + } +}) + +-- Cooking +minetest.register_craft({ + type = 'cooking', + recipe = "bitchange:coinbase", + output = "bitchange:mineninth", +}) + +minetest.register_craft({ + type = 'cooking', + recipe = "default:goldblock", + output = "bitchange:minecoinblock 2", +}) +minetest.register_craft({ + type = 'cooking', + recipe = "bitchange:minecoinblock", + output = "default:gold_ingot 4", +}) + +-- Generation +minetest.register_ore({ + ore_type = "scatter", + ore = "bitchange:minecoin_in_ground", + wherein = "default:stone", + clust_scarcity = 15*15*15, + clust_num_ores = 3, + clust_size = 7, + height_max = -512, + height_min = -18000, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "bitchange:mineninth_in_ground", + wherein = "default:stone", + clust_scarcity = 12*12*12, + clust_num_ores = 5, + clust_size = 8, + height_max = -256, + height_min = -511, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "bitchange:mineninth_in_ground", + wherein = "default:stone", + clust_scarcity = 13*13*13, + clust_num_ores = 3, + clust_size = 7, + height_max = 28000, + height_min = -255, +}) \ No newline at end of file diff --git a/moneychanger.lua b/moneychanger.lua new file mode 100644 index 0000000..84e0002 --- /dev/null +++ b/moneychanger.lua @@ -0,0 +1,193 @@ +--Created by Krock for the BitChange mod +--License: WTFPL + +moneychanger = {} +moneychanger.constructing = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", "size[8,7]" .. + "list[current_name;source;0,1;1,1;]" .. + "label[0,0;Input money]" .. + "list[current_name;output;2,1;2,1;]" .. + "label[2,0;Possible converts]" .. + "list[current_name;rest;5,1;1,1;]" .. + "label[5,0;Remaining money]" .. + "list[current_player;main;0,3;8,4;]") +end +moneychanger.update_fields = function(pos, listname, index, stack, take) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local stack_inv = inv:get_stack(listname, index) + local stack_rest = inv:get_stack("rest", 1) + local stack_name = stack:get_name() + local stack_src = inv:get_stack("source", 1) + local stack_src_name = stack_src:get_name() + local stack_real_count = 0 + local canMove = false + if(take) then + stack_real_count = stack_inv:get_count() - stack:get_count() + else + if(stack_inv:get_name() ~= "") then + stack_real_count = stack_inv:get_count() + stack:get_count() + else + stack_real_count = stack:get_count() + end + end + + if(listname == "source" and (stack_rest:get_count() == 0 or take)) then + inv:set_list("output", { "", "" }) + if(stack_real_count > 0) then + if(stack_name == "bitchange:minecoinblock") then + inv:set_list("output", { "bitchange:minecoin "..(stack_real_count*9), "" }) + elseif(stack_name == "bitchange:minecoin") then + inv:set_list("output", { "bitchange:mineninth "..math.min(stack_real_count*9, 30000), "bitchange:minecoinblock "..math.floor(stack_real_count/9) }) + else + inv:set_list("output", { "bitchange:minecoin "..math.min(math.floor(stack_real_count/9), 30000), "" }) + end + canMove = true + elseif(stack_real_count == 0 and stack_src:get_count() > 0) then + canMove = true + end + elseif(listname == "output" and stack_rest:get_count() == 0) then + if(stack_src:get_count() < 1) then + if(stack:get_count() > 0) then + canMove = true + end + inv:set_list("source", { "" }) + else + if(stack_src_name ~= "") then + if(stack_name == "bitchange:minecoinblock" and stack_src_name == "bitchange:minecoin") then + local amount_left = (stack_src:get_count() - (stack:get_count()*9)) + if(amount_left > 0) then + inv:set_list("source", { stack_src_name.." "..amount_left }) + else + inv:set_list("source", { "" }) + end + if(index == 1) then + inv:set_stack("output", 2, "") + else + inv:set_stack("output", 1, "") + end + canMove = true + elseif(stack_name == "bitchange:minecoin" and stack_src_name == "bitchange:mineninth") then + local amount_left = (stack_src:get_count() - (stack:get_count()*9)) + if(amount_left > 0) then + inv:set_list("source", { stack_src_name.." "..amount_left }) + else + inv:set_list("source", { "" }) + end + canMove = true + elseif(stack_name == "bitchange:minecoin" and stack_src_name == "bitchange:minecoinblock") then + local amount_left = stack_src:get_count() - (stack:get_count()/9) + local rest_count = (amount_left - math.floor(amount_left))*9 + if(amount_left > -1) then + inv:set_list("source", { stack_src_name.." "..math.floor(amount_left) }) + if(rest_count > 0) then + inv:set_list("rest", { stack_name.." "..rest_count }) + else + inv:set_list("rest", { "" }) + end + if(index == 1) then + inv:set_stack("output", 2, "") + else + inv:set_stack("output", 1, "") + end + inv:set_stack("output", index, stack_name.." "..stack:get_count()) + canMove = true + end + elseif(stack_name == "bitchange:mineninth" and stack_src_name == "bitchange:minecoin") then + local amount_left = stack_src:get_count() - (stack:get_count()/9) + local rest_count = (amount_left - math.floor(amount_left))*9 + if(amount_left > -1) then + inv:set_list("source", { stack_src_name.." "..math.floor(amount_left) }) + if(rest_count > 0) then + inv:set_list("rest", { stack_name.." "..rest_count }) + else + inv:set_list("rest", { "" }) + end + if(index == 1) then + inv:set_stack("output", 2, "") + else + inv:set_stack("output", 1, "") + end + inv:set_stack("output", index, stack_name.." "..stack:get_count()) + canMove = true + end + end + end + end + elseif(listname == "rest") then + canMove = true + end + if(canMove) then + return stack:get_count() + else + return 0 + end +end + +minetest.register_node("bitchange:moneychanger", { + description = "Moneychanger", + tiles = {"bitchange_moneychanger_top.png", "bitchange_moneychanger_top.png", "bitchange_moneychanger_side.png", + "bitchange_moneychanger_side.png", "bitchange_moneychanger_top.png", "bitchange_moneychanger_front.png"}, + paramtype2 = "facedir", + groups = {cracky=1}, + legacy_facedir_simple = true, + sounds = default.node_sound_stone_defaults(), + on_construct = function(pos) + return moneychanger.constructing(pos); + end, + after_place_node = function(pos, placer, itemstack) + local owner = placer:get_player_name() + local meta = minetest.get_meta(pos) + meta:set_string("infotext", "Moneychanger (owned by "..owner..")") + meta:set_string("owner",owner) + local inv = meta:get_inventory() + inv:set_size("source", 1) + inv:set_size("rest", 1) + inv:set_size("output", 2) + end, + allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + return 0 + end, + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + if(player:get_player_name() ~= meta:get_string("owner")) then + return 0 + end + if(listname == "source") then + local stack_name = stack:get_name() + if(stack_name == "bitchange:mineninth" or stack_name == "bitchange:minecoin" or stack_name == "bitchange:minecoinblock") then + return moneychanger.update_fields(pos, listname, index, stack, false) + else + return 0 + end + else + return 0 + end + end, + allow_metadata_inventory_take = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + if(player:get_player_name() == meta:get_string("owner") or minetest.get_player_privs(name)["server"]) then + return moneychanger.update_fields(pos, listname, index, stack, true) + else + return 0 + end + end, + can_dig = function(pos, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + if(player:get_player_name() ~= meta:get_string("owner") and not minetest.get_player_privs(name)["server"]) then + return 0 + end + return inv:is_empty("source") and inv:is_empty("output") and inv:is_empty("rest") + end +}) + +minetest.register_craft({ + output = 'bitchange:moneychanger', + recipe = { + {'default:stone', 'bitchange:mineninth', 'default:stone'}, + {'default:steel_ingot', 'bitchange:minecoin', 'default:steel_ingot'}, + {'default:stone', 'default:stone', 'default:stone'} + } +}) \ No newline at end of file diff --git a/moreores.lua b/moreores.lua new file mode 100644 index 0000000..43f56a6 --- /dev/null +++ b/moreores.lua @@ -0,0 +1,126 @@ +--Created by Krock +--License: WTFPL + +if (bitchange_use_moreores_tin) then + if(bitchange_need_generate_tin) then + minetest.register_node(":moreores:mineral_tin", { + description = "Tin Ore", + tiles = {"default_stone.png^moreores_mineral_tin.png"}, + groups = {cracky=3}, + sounds = default.node_sound_stone_defaults(), + drop = 'craft "moreores:tin_lump" 1' + }) + minetest.register_node(":moreores:tin_block", { + description = "Tin Block", + tiles = { "moreores_tin_block.png" }, + groups = {snappy=1,bendy=2,cracky=1,melty=2,level=2}, + sounds = default.node_sound_stone_defaults() + }) + minetest.register_ore({ + ore_type = "scatter", + ore = "moreores:mineral_tin", + wherein = "default:stone", + clust_scarcity = 7*7*7, + clust_num_ores = 3, + clust_size = 7, + height_min = -31000, + height_max = 8, + }) + minetest.register_craftitem(":moreores:tin_lump", { + description = "Tin Lump", + inventory_image = "moreores_tin_lump.png", + }) + minetest.register_craftitem(":moreores:tin_ingot", { + description = "Tin Ingot", + inventory_image = "moreores_tin_ingot.png", + }) + minetest.register_craft({ + output = "moreores:tin_block", + recipe = { + {"moreores:tin_ingot", "moreores:tin_ingot", "moreores:tin_ingot"}, + {"moreores:tin_ingot", "moreores:tin_ingot", "moreores:tin_ingot"}, + {"moreores:tin_ingot", "moreores:tin_ingot", "moreores:tin_ingot"}, + } + }) + minetest.register_craft({ + output = "moreores:tin_ingot 9", + recipe = { { "moreores:tin_block" } } + }) + minetest.register_craft({ + type = 'cooking', + recipe = "moreores:tin_lump", + output = "moreores:tin_ingot", + }) + end + minetest.register_craft({ + output = "bitchange:coinbase 18", + recipe = { + {"moreores:tin_block", "default:pick_diamond"}, + {"moreores:tin_block", ""} + }, + replacements = { {"default:pick_diamond", "default:pick_diamond"} }, + }) +end + +if (bitchange_use_technic_zinc) then + if (bitchange_need_generate_zinc) then + minetest.register_node(":technic:mineral_zinc", { + description = "Zinc Ore", + tile_images = { "default_stone.png^technic_mineral_zinc.png" }, + is_ground_content = true, + groups = {cracky=3}, + sounds = default.node_sound_stone_defaults(), + drop = 'craft "technic:zinc_lump" 1', + }) + minetest.register_node(":technic:zinc_block", { + description = "Zinc Block", + tiles = { "technic_zinc_block.png" }, + is_ground_content = true, + groups = {cracky=1, level=2}, + sounds = default.node_sound_stone_defaults() + }) + minetest.register_ore({ + ore_type = "scatter", + ore = "technic:mineral_zinc", + wherein = "default:stone", + clust_scarcity = 9*9*9, + clust_num_ores = 4, + clust_size = 3, + height_min = -31000, + height_max = 2, + }) + minetest.register_craftitem(":technic:zinc_lump", { + description = "Zinc Lump", + inventory_image = "technic_zinc_lump.png", + }) + minetest.register_craftitem(":technic:zinc_ingot", { + description = "Zinc Ingot", + inventory_image = "technic_zinc_ingot.png", + }) + minetest.register_craft({ + output = "technic:zinc_block", + recipe = { + {"technic:zinc_ingot", "technic:zinc_ingot", "technic:zinc_ingot"}, + {"technic:zinc_ingot", "technic:zinc_ingot", "technic:zinc_ingot"}, + {"technic:zinc_ingot", "technic:zinc_ingot", "technic:zinc_ingot"}, + } + }) + minetest.register_craft({ + output = "technic:zinc_block 9", + recipe = { { "technic:zinc_block" } } + }) + minetest.register_craft({ + type = 'cooking', + recipe = "technic:zinc_lump", + output = "technic:zinc_ingot", + }) + end + minetest.register_craft({ + output = "bitchange:coinbase 8", + recipe = { + {"technic:zinc_block", "default:pick_diamond"}, + {"technic:zinc_block", ""} + }, + replacements = { {"default:pick_diamond", "default:pick_diamond"} }, + }) +end \ No newline at end of file diff --git a/shop.lua b/shop.lua new file mode 100644 index 0000000..a463605 --- /dev/null +++ b/shop.lua @@ -0,0 +1,314 @@ +--Created by Krock for the BitChange mod +--Parts of codes, images and ideas from Dan Duncombe's exchange shop +-- https://forum.minetest.net/viewtopic.php?id=7002 +--License: WTFPL + +local exchange_shop = {} + +local function has_exchange_shop_privilege(meta, player) + local player_name = player:get_player_name() + return ((player_name == meta:get_string("owner")) or minetest.get_player_privs(player_name).server) +end + +local function get_exchange_shop_formspec(number,pos,title) + local formspec = "" + local name = "nodemeta:"..pos.x..","..pos.y..","..pos.z + if(number == 1) then + -- customer + formspec = ("size[8,9;]".. + "label[0,0;Exchange shop]".. + "label[1,0.5;Owner needs:]".. + "list["..name..";cust_ow;1,1;2,2;]".. + "button[3,2.5;2,1;exchange;Exchange]".. + "label[5,0.5;Owner gives:]".. + "list["..name..";cust_og;5,1;2,2;]".. + "label[1,3.5;Ejected items:]".. + "list["..name..";cust_ej;3,3.5;4,1;]".. + "list[current_player;main;0,5;8,4;]") + elseif(number == 2 or number == 3) then + -- owner + formspec = ("size[11,10;]".. + "label[0,0;Exchange shop]".. + "field[2.5,0.5;3,0.2;title;;"..title.."]".. + "label[0,0.7;You need:]".. + "list["..name..";cust_ow;0,1.2;2,2;]".. + "label[3,0.7;You give:]".. + "list["..name..";cust_og;3,1.2;2,2;]".. + "label[1,3.5;Ejected items:]".. + "list["..name..";custm_ej;0,4;4,1;]".. + "label[6,0;You are viewing:]") + if(number == 2) then + formspec = (formspec.."button[8.5,0;2.5,1;vstock;Customers stock]".. + "list["..name..";custm;6,1;5,4;]") + else + formspec = (formspec.."button[8.5,0;2.5,1;vcustm;Your stock]".. + "list["..name..";stock;6,1;5,4;]") + end + formspec = (formspec.. + "label[1,5;Use (E) + (Right click) for customer interface]".. + "list[current_player;main;1,6;8,4;]") + end + return formspec +end + +local function get_exchange_shop_tube_config(mode) + if(bitchange_exchangeshop_pipeworks) then + if(mode == 1) then + return {choppy=2, oddly_breakable_by_hand=2, tubedevice=1, tubedevice_receiver=1} + else + return { + insert_object = function(pos, node, stack, direction) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + return inv:add_item("stock",stack) + end, + can_insert = function(pos, node, stack, direction) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + return inv:room_for_item("stock",stack) + end, + input_inventory="custm", + connect_sides = {left=1, right=1, back=1, top=1, bottom=1} + } + end + else + if(mode == 1) then + return {choppy=2,oddly_breakable_by_hand=2} + else + return { + insert_object = function(pos, node, stack, direction) + return false + end, + can_insert = function(pos, node, stack, direction) + return false + end, + connect_sides = {} + } + end + end +end + +minetest.register_on_player_receive_fields(function(sender, formname, fields) + if (formname == "bitchange:shop_formspec") then + local player_name = sender:get_player_name() + local pos = exchange_shop[player_name] + local meta = minetest.get_meta(pos) + local title = meta:get_string("title") or "" + + if(fields.exchange) then + local player_inv = sender:get_inventory() + local shop_inv = meta:get_inventory() + local err_msg = "" + local cust_ow = shop_inv:get_list("cust_ow") + local cust_og = shop_inv:get_list("cust_og") + local cust_ow_legal = true + local cust_og_legal = true + --?shop configured well + for i1, item1 in pairs(cust_ow) do + for i2, item2 in pairs(cust_ow) do + if (item1:get_name() == item2:get_name() and i1 ~= i2 and item1:get_name() ~= "") then + cust_ow_legal = false + --break + end + end + if(not cust_ow_legal) then + break + end + end + if(not cust_ow_legal) then + err_msg = "The 'Owner needs' field can not contain multiple times the same items, contact the shop owner." + end + if(err_msg == "") then --?shop configured well + for i1, item1 in pairs(cust_og) do + for i2, item2 in pairs(cust_og) do + if (item1:get_name() == item2:get_name() and i1 ~= i2 and item1:get_name() ~= "") then + cust_og_legal = false + break + end + end + if(not cust_og_legal) then + break + end + end + if(not cust_og_legal) then + err_msg = "The 'Owner gives' field can not contain multiple times the same items, contact the shop owner." + end + end + if(err_msg == "") then --?player has space + local player_has_space = true + for i, item in pairs(cust_og) do + if (not player_inv:room_for_item("main",item)) then + player_has_space = false + break + end + end + if(not player_has_space) then + err_msg = "You do not have the space in your inventory." + end + end + if(err_msg == "") then --?player has items + local player_has_items = true + for i, item in pairs(cust_ow) do + if (not player_inv:contains_item("main",item)) then + player_has_items = false + break + end + end + if(not player_has_items) then + err_msg = "You do not have the needed items." + end + end + if(err_msg == "") then --?shop has space + local shop_has_space = true + for i, item in pairs(cust_ow) do + if (not shop_inv:room_for_item("custm",item)) then + shop_has_space = false + break + end + end + if(not shop_has_space) then + err_msg = "Exchange shop: The stock in the shop is full." + end + end + if(err_msg == "") then --?shop has items + local shop_has_items = true + for i, item in pairs(cust_og) do + if (not shop_inv:contains_item("stock",item)) then + shop_has_items = false + break + end + end + if(not shop_has_items) then + err_msg = "The shop is empty and can not give you anything." + end + end + if(err_msg == "") then --?exchange + local fully_exchanged = true + for i, item in pairs(cust_ow) do + player_inv:remove_item("main", item) --player inv. to stock else to eject fields + if (shop_inv:room_for_item("custm",item)) then + shop_inv:add_item("custm", item) + else + shop_inv:add_item("custm_ej", item) + fully_exchanged = false + end + end + for i, item in pairs(cust_og) do + shop_inv:remove_item("stock", item) --stock to player inv. else to eject fields + if (player_inv:room_for_item("main",item)) then + player_inv:add_item("main", item) + else + shop_inv:add_item("cust_ej", item) + fully_exchanged = false + end + end + if(not fully_exchanged) then + err_msg = "Fatal error! Stocks are overflowing somewhere!" + end + end + if(err_msg ~= "") then + minetest.chat_send_player(player_name, "Exchange shop: "..err_msg) + end + elseif(fields.vstock and has_exchange_shop_privilege(meta, sender) and not fields.quit) then + minetest.show_formspec(sender:get_player_name(),"bitchange:shop_formspec",get_exchange_shop_formspec(3, pos, title)) + elseif(fields.vcustm and has_exchange_shop_privilege(meta, sender) and not fields.quit) then + minetest.show_formspec(sender:get_player_name(),"bitchange:shop_formspec",get_exchange_shop_formspec(2, pos, title)) + elseif(fields.quit and has_exchange_shop_privilege(meta, sender)) then + if(fields.title and title ~= fields.title) then + if(fields.title ~= "") then + meta:set_string("infotext", "Exchange shop \""..fields.title.."\" (owned by ".. + meta:get_string("owner")..")") + else + meta:set_string("infotext", "Exchange shop (owned by ".. + meta:get_string("owner")..")") + end + meta:set_string("title", fields.title) + end + end + end +end) + +minetest.register_node("bitchange:shop", { + description = "Shop", + tiles = {"bitchange_shop_top.png", "bitchange_shop_top.png", + "bitchange_shop_side.png", "bitchange_shop_side.png", + "bitchange_shop_side.png", "bitchange_shop_front.png"}, + paramtype2 = "facedir", + groups = get_exchange_shop_tube_config(1), + tube = get_exchange_shop_tube_config(2), + sounds = default.node_sound_wood_defaults(), + after_place_node = function(pos, placer) + local meta = minetest.get_meta(pos) + meta:set_string("owner", placer:get_player_name()) + meta:set_string("infotext", "Exchange shop (owned by ".. + meta:get_string("owner")..")") + end, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", "Exchange shop (constructing)") + meta:set_string("formspec", "") + meta:set_string("owner", "") + local inv = meta:get_inventory() + inv:set_size("stock", 5*4) -- needed stock for exchanges + inv:set_size("custm", 5*4) -- stock of the customers exchanges + inv:set_size("custm_ej", 4) -- ejected items if shop has no inventory room + inv:set_size("cust_ow", 2*2) -- owner wants + inv:set_size("cust_og", 2*2) -- owner gives + inv:set_size("cust_ej", 4) -- ejected items if player has no inventory room + end, + can_dig = function(pos,player) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + if(inv:is_empty("stock") and inv:is_empty("custm") and inv:is_empty("custm_ej") and inv:is_empty("cust_ow") and inv:is_empty("cust_og") and inv:is_empty("cust_ej")) then + return true + else + minetest.chat_send_player(player:get_player_name(), "Can not dig exchange shop, one or multiple stocks are in use.") + return false + end + end, + on_rightclick = function(pos, node, clicker, itemstack) + local meta = minetest.get_meta(pos) + local player_name = clicker:get_player_name() + local view = 0 + exchange_shop[player_name] = pos + if player_name == meta:get_string("owner") then + if(clicker:get_player_control().aux1) then + view = 1 + else + view = 2 + end + else + view = 1 + end + minetest.show_formspec(player_name,"bitchange:shop_formspec",get_exchange_shop_formspec(view, pos, meta:get_string("title"))) + end, + allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + local meta = minetest.get_meta(pos) + if (not has_exchange_shop_privilege(meta, player)) then + return 0 + end + return count + end, + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + if (has_exchange_shop_privilege(meta, player) and (listname ~= "cust_ej") and (listname ~= "custm_ej")) then + return stack:get_count() + end + return 0 + end, + allow_metadata_inventory_take = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + if (has_exchange_shop_privilege(meta, player) or (listname == "cust_ej")) then + return stack:get_count() + end + return 0 + end, +}) + +minetest.register_craft({ + output = 'bitchange:shop', + recipe = { + {'default:sign_wall'}, + {'default:chest_locked'}, + } +}) \ No newline at end of file diff --git a/textures/16px/bitchange_bank_front.png b/textures/16px/bitchange_bank_front.png new file mode 100644 index 0000000000000000000000000000000000000000..c96f0eadd6043ab9bdb84f288cbba04c740496b5 GIT binary patch literal 522 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCijSl0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP=d3- zBeIx*f$uN~Gak=hkpdKyDshb{3C>R|DNig)We7;j%q!9Ja}7}_GuAWJGc+*xQnV20 z1Yb`V#}Etud)#^R6(n{oFb8=ti@bc}ksSZ%*>f5t#DiM6^We zwSeHDfB=RN<`AB%6XY`|CY+t|N@<1m={xh*Sg$?7*3rPDV16=?LFMVvo(l{ibKjic zp3=60L8*g{Lt1Ix8=W~%mve1p%wV_^(vh{pY)9IHCKl}p#SRu%T{(Q2kFa(4?fBeK z*PO*rCH^8nVZWLa=Vg9}gDULrRII;kdzRI*ysO;0T^YDhJ#YP{EM!SfR|DNig)We7;j%q!9Ja}7}_GuAWJGc+*xQnV1L zYL=&qV~B}vn3yZgY`>oAjG5^J0_eGE9 zOuk!f#i&(zC}tyLMvvizjuzKm=ki>KW?NQmL)Q763Yjg;H5Zsxh%AZxUY&DMPa#h= zDY|(^fr?bj(<3w1^Zs$xx^FJ<{K|u0O|??tR?ey1(smnJ>jvcGA!lvI6;>1s;*b z3=G_YAk0{w5<>&kwYnN398>W2Kat3V;C64!{5;QX|b^2DN4hJeJ(yb?V> z*ARs=V?9$nLj!{^MGJwdu6VjQhFJKooxG9vkb!{fTg@9SxtrLPD+H!3a9rfTA>}ez zVWY!}2^kBlKh3SF;d5tc^oZX!`S*G8-{-8qc6h|hEw_8|eUAS!qsMou=Q|~|yjrU* z)#~=i?MIk_olw;?-k#-4*Yb7EU;N9wv^1Cw_)A%sr{WaH(BzcOTQ8Rq~7$0T~9(>-f%OU)g$K zb?we$`$ZEiOm22 literal 0 HcmV?d00001 diff --git a/textures/16px/bitchange_mineninth.png b/textures/16px/bitchange_mineninth.png new file mode 100644 index 0000000000000000000000000000000000000000..f44a10e285ac6b2132f0a2d91c938e354366037a GIT binary patch literal 334 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=DjSK$uZf!>a)(C{^MbQ4*Y=R#Ki=l*$m0n3-3i=jR%tP-d)Ws%L0m@TF)WP}M0< z7sn6_|Fx43@*Y;;aXpxT(-2PB*VwmJ!Jc0O`$_Recw zvl#50EWXY&V@l{T%*$HKo6WfK@0lO-Z}K#MpEswtR%aR|DNig)We7;j%q!9Ja}7}_GuAWJGc+*xQnV20 z1a40k#}Etu#er=C_ZJ2y=4I6lS`A*exz{#uoM_01*qSAJ#q-L=4{r*rj(9q-`AIi?b2{)# tE;+@Yd8fm7hq)|1_Z+4RayE1^Uf(rY=SxibJ7C~3c)I$ztaD0e0svFlp-cb( literal 0 HcmV?d00001 diff --git a/textures/16px/bitchange_moneychanger_side.png b/textures/16px/bitchange_moneychanger_side.png new file mode 100644 index 0000000000000000000000000000000000000000..c85bc837741c4ce7f85a738b55880def3dff3113 GIT binary patch literal 282 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCijSl0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP=d3- zBeIx*f$uN~Gak=hkpdKyDshb{3C>R|DNig)We7;j%q!9Ja}7}_GuAWJGc+*xQnV1L zD%R7*F~q`u?j%J%21Ong%j@pSul*({2&jAfNPRjrMc&}0#2LSaGWqiUj$;O!uT|U6 z;E7L6R;iKTc6EyDaYXtd%bKeol1Ly-Ek8Kg@GJ&7JA< SgXI*^A_h-aKbLh*2~7a6zgDaO literal 0 HcmV?d00001 diff --git a/textures/16px/bitchange_moneychanger_top.png b/textures/16px/bitchange_moneychanger_top.png new file mode 100644 index 0000000000000000000000000000000000000000..b7161195fe83db256f1183ebb9883f05e2bdc8ad GIT binary patch literal 361 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCijSl0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP=d3- zBeIx*f$uN~Gak=hkpdKyDshb{3C>R|DNig)We7;j%q!9Ja}7}_GuAWJGc+*xQnV1L zYK^ChV~B-+Z_q|QXGM-Bvzz6!WqjSm|6f12G5vk(apy_XT$&EJo_l`wl;Fw7L?_ z%Incy#m=z1VEMhWC40Ri^4BSz?R;yL@sHu~^o)zA?yTd3Gp!32!i3f;=pLknm@ZUJ8$N_nP=gr`l$PNKJa0Z5M@J}sz3(;K^UWh5T!iU z7^=%DQI<1Y+rU)?&KjI4Nd{xYH5Io$`-(_`#6n#eLIpnPsEtB!3^Pq_1M;+^pC{;e zNLd!V`sO=`mJoAsju+wLAA>Q5C<<}b6UBu2Cw zT3ZnhR_R)Y{PEKloF5;PFZJV6dTv2c)Rg6%(P+f=>(`k~CTwnQGMP*`JUqlU4Xv#RdkJY2;k`$c3OIdugbD?3 zE4tS5&FAm)#(SS)t)<`Zb9{Wv;ddV+aZH}|@Nti9`3k=45FG^E{`M|j0<3ERPuF_x z{qj8Te)uH-w{E=NI3`n`m-*Q4tk;>?0_W>^$6&MpcTi<+Kzk~jnvU~K#UJ57I>VO>Y( zJib-IjeYN{V}TfCG}!KIv4_;*`N3L4_r5J$j!kW`v3p{07*qoM6N<$g154T A#{d8T literal 0 HcmV?d00001 diff --git a/textures/16px/bitchange_shop_side.png b/textures/16px/bitchange_shop_side.png new file mode 100644 index 0000000000000000000000000000000000000000..712364c52d36a716ce0cb7c2d3b308febd02288e GIT binary patch literal 755 zcmV zo+DwM`ReO$DHKR4EVIKZ$R@Ekg%Ic)&EgGRo!E30y6hRpflogD0?}e|_dBu(_ty^R z97SOXK2wy66k#3;#A=qMWOf6K-=hGrCDNR{!EVvG-H0X<5uyudV4D+G3zY~cAsQi? zikv(daKjD}TVm40wt{K$D4!7nVgW7KrlP;-AV9r6p{*O7n;Gt|iQc2;o9Ee&S4i0r zgF{P!mKu~M%saG{#AQO4HPH=_Bhk;4+e=am$R9s_!|v59x|0n#CW@xU))ir0neGo% zO~viYYfc_q5Z0CXI8wGXVlDlHOXU2W$Ncc~Z#Z{DvNfvQ;+BONJ>-BQp>st4Jy9t^ zN@3*<3!N4HLt#FpftQV2vRJ@P5HBk-AVAS&4qewiR_zkaI?qGTi+2 zJIV^#&!p&C=77?ImV#k_MCE|hHO`cDO-n9YnzJ{_DIwYzzW?qySqwfzAd_OI?*yg5 z7{ggtaT5dMurm8ZcX~?KRDAs5`$*Alc>MGU-g|ToSTTq-)cq+&1HqGG;&^o2-|fjM zvuP{pwk4&21UE4r9Mf>%?tWmJ7Fx+vr3GbhKK}ot+4K!QBvQ!asK{wWl+kDf-ARXv zf%DFy#W1=Rk%C4mnyO-5J?H0VD6Of=f>MB-5ppKFBgf%DT{rk_SeFG!fiRBj=Y^)~ z=(aWg-d@pfTT0Vmn+_!<5)Oaz*$0=LJ$yn@*Br0@VRkEVcD(!EGhV;=mGLlh@$fC? lDHhYGwcc002ovPDHLkV1i}3Ut<6O literal 0 HcmV?d00001 diff --git a/textures/16px/bitchange_shop_top.png b/textures/16px/bitchange_shop_top.png new file mode 100644 index 0000000000000000000000000000000000000000..b4e2599beb2f921847e794afbac2dd0340112d32 GIT binary patch literal 734 zcmV<40wMj0P)af=hzx{45Fjx- zJ2O39)n%7mHUUrcsNaA5s@k@t>G!P5gf<3a9okrws-zHDPIolDXaD|7@-mTAAcvWD zyhif6@bx#}(kKuo#3f)AR8xpSA!PQwCMJXL3OnDT-JW@#c>Tqfh!#tDe4vW(cpC^I z&@`5uDveW=4VI}vtR_as5+-6gp#ZTC>95}7A!@?IjAmm)*g{4FV=Y)Mv?8E{%?O)m zsU=Z?Fg+k*9j06uTew^jDpkaQSU?N5Z`nWdkf9r|7`mPi7N+}Kwv-TMgr9%8$2Nk~ znQ5)$41KT%6%H?(xaKq(o?;llhBxJ*yn zKTcdOkwGf0v!DziZU4V$cKe=`3nf?Trl@5_l+kDf{>r1a%(b^@G0b5_q@mY}zHM38 z#P#(Nr8TW~TA_Q6M-Z~tUn7KY;uDV)i1!FD51>5nh?4@Ean+bVHb QW&i*H07*qoM6N<$f)VLaj{pDw literal 0 HcmV?d00001 diff --git a/textures/16px/bitchange_warehouse_front.png b/textures/16px/bitchange_warehouse_front.png new file mode 100644 index 0000000000000000000000000000000000000000..d8cb976d7a25ed93255edfca252d1aed8c962570 GIT binary patch literal 485 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCijSl0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP=d3- zBeIx*fo~NEGsdh|lK={`mw5WRvftqm7S}XC{p`(DppaCFYeY$Kep*R+Vo@qXKw@TI ziJqTph(ejMo~fRpfx(xeg+Nz{db&7H{% z?7EXHozxS#K;py0nP>IhMs-ZT;B(pj{!HWaSw*>3-`2A;*Uhbb{zi1w#>ie@S+l|y zJG|UOt=4ex=KM;UTsM=We9xo{3mshrxU?q6b=pin5qvR#*;CpgGhlm$jaZA^r{9bl zy_Fwaxhwp=(s}x=hV%DT^KRUEW_LU7hS79$wf*PnVp8wx8|R-r^G8Y6%b@C?r+l8c`CQpH@)Hh zrHx{$E~^iJ5>xo>#pKIla@&_s~X;ElILLfgRjQ96X$% zwj$G77BD%#VNl{Sbnt3aG|JX_m3p-7LAL4wMP`)=U2Qxyx^~%5_Wsb9=CoLspRwZb c`|~_c*lk-^D((O32nrnrPgg&ebxsLQ0QdBsyZ`_I literal 0 HcmV?d00001 diff --git a/textures/16px/bitchange_warehouse_top.png b/textures/16px/bitchange_warehouse_top.png new file mode 100644 index 0000000000000000000000000000000000000000..d18859c4cf26992803251173cb3684086e37223e GIT binary patch literal 441 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCijSl0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP=d3- zBeIx*fo~NEGsdh|lK={`mw5WRvftqm7T4hFnmX|)P)Mr8HKHUqKdq!Zu_%=xATcwq zM9KLZGUbo-U3d7XDKw-R3*!AkbFHb2smFa!1zHg?@$lf(!cu zTLkoM_O741*5l5NG^?5aKL0n~Jy-KQ)AE$B3NzTxEqb|RVw8K<<)GU)M3vbX)w$EJ ztw_0A`7`e6mDo4$ZogaDoM~goVG+4lkkQnkc$Hn**Olo#5-fApd@+=L;jNlDU-j1jXG5$Y=g<_vPb}MTWjksa6H{erG&aaJ@JDH2<;IJfKb;nY>TB zC(ikLW*x5c&8kS65VN43)l7EH`-H#K*E~mdKI;Vst0O;hTh5!Hn literal 0 HcmV?d00001 diff --git a/textures/bitchange_bank_front.png b/textures/bitchange_bank_front.png new file mode 100644 index 0000000000000000000000000000000000000000..f2362f248627e7f27e95d61ce4f2dea4dc801d7d GIT binary patch literal 988 zcmV<210(#2P)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGi!vFvd!vV){sAK>D02*{fSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@H7+qQF!XYv0009YNkl@M#lJ15ags zz=*ccN+qH`d9}a0x&HDtb?%r0Xrfb&q0B&IJ-i44dJZxm^x|y9N~+KVK?IA_z0|DC z-9&R{u+yCuXsk?MVe&j}%mD$YN-xqz^rT-k07vot)eu0r=~p)pEN2I80{pU)XOW;^ ztr-zjqWVzyjRzF=!=WMwCSWre5mlo41QP&CA8vA}2pSL0fVP1G)t41>=K(0J*g*jO zn28S0B=$=8Ni)3m<);zi`()kq-sf~U_fJa>6;Tpy4xkVLSO4qMJwJl~Vr~EMzGm+M zY4+Qf-F)J7Dbu4IE+%08uyADtGz-3hg%Y}I6{OtCTp#qBpSs4z;3pO8=fe#7Lpi9- z>ypXV;B9u>Z_D{q7k0^vwMq-(>Jg}IO5M}^d-MlDCHRK3X44xxe7d}i@c7wpW4 zHbZu5Uev*VhqEMMMMw`q~LPX zmq4nB2>c*|`xOHFBujaKU_GTBId~5oRv}gYaW%VbjUsB#@8Gj;j&N-1574OuI;o## zVLB_@wrkHjmK^6kAMz5W+{4%>JP4G_lX9{=&n=_7FGY?&9K{LHly!6eR^a?rre3_r zWY`IUucz!tij}d`*%`P?A*&%*C+T?|Zja)g{S3A?*6?*q0r0=Tr<_GiIh5uA0000< KMNUMnLSTZI-LVJ& literal 0 HcmV?d00001 diff --git a/textures/bitchange_bank_side.png b/textures/bitchange_bank_side.png new file mode 100644 index 0000000000000000000000000000000000000000..ac0bdaf7392dbdb137eeedf936143843d44c47c3 GIT binary patch literal 619 zcmV-x0+juUP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGi!vFvd!vV){sAK>D02*{fSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@H7+qQF!XYv00055Nkl05*8#v< zXV!utr6d>PgStR!+4n7MCDT~rbxFoGRG8_O<7V!t^mBemgkOb%bq-nOk z@_kmi#E^7()H9}mMKdzk((R7-Fv(1q+HhMsJKmC$Hd%%f)-&=nV~_kgv4aX#`Xb9_ z<_9gZ9kX*(No?W4mqTJ#`Qj_XvrV}--urya@0vwTIxe_`6zA}4V@f3G znI^L$inj1&i$rIPGLtObs~Ts8!3rh1s4Qx(vl=OiCQ8F)RH+bvnT~R+YunLqy)u~< zGnwQLL6Mk*ax+e)f&oNlP%C+0M&bD%;Olyczc>BD`5zSZ&fE={sR951002ovPDHLk FV1l}K{GI>+ literal 0 HcmV?d00001 diff --git a/textures/bitchange_coinbase.png b/textures/bitchange_coinbase.png new file mode 100644 index 0000000000000000000000000000000000000000..f25c788b8629274e3de7a3fe24b1e7e0f603673b GIT binary patch literal 482 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCijSl0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP=d3- zBeIx*f$uN~Gak=hkpdKyDshb{3C>R|DNig)We7;j%q!9Ja}7}_GuAWJGc+*xQnV20 z1XWKL#}Etut&^?&S_1^y)~_z$EGv6=aP1EE>q*WlJTy4on?L!~#$sS1_AM;$!J+qO zJokLm%5YRsY%Kn<|K~ZM9ZUr`N(~dv@730M^F8E$eZ#U${(8wgImN!mzirM7wmp2C zKOvN%HGh&yql#xh=+~L|w=1k>xNI`NYmvkK?;CQf6%Q;s%FnPmJap@ief^I=b|`Qp zNE~}T?I^3l=}p!_^LMXfmcH=Q|Bp?da?JIs*A>zkviS}hTrWNAXwheUInZIU!)22V zI^6S~@2zd;U|?NW8XNBs8cg`e@^9w_Sqf-P)R6O(wqnxwp?cezBFc}ynRd;9ITyWj5BnHv5^+RWL8Ceva++F;E75b5YSHKp7XT%voo69aS#ZMC>yI%A5s%XvFQ-17ChR;c^utQX$WIOK@b=L zhIR<_Oi86{h5t+BK@i_Fa<2r$-Lujm!omAfJ9HxNlN1Zh(rUxoe=;S?=V-j1<6m66aXMt6Ce6c zJFA1I9Ib_@8bD(Jfa1CUBn2(1fJkOi0N82O+bvfK0BN?gpw*zuD3eO?p2%hxh+qn^ zSrJtO1kr2DRRHiy_XawT;9V_X@z4plEjbDUVD~sFP#Zc(1xLF|~Eh1TSsBH)JR6fENyBAWB=z@ZvZE9J~XlJDz=ZGCIHiVZOG zn^k>)#w0-8)x22k+HwTstNJ7;if=@R^D?#8tT!QjKR{B^j2$_A#;N^2paX~3xQet# z0b*f*HZB1Ot98_CnSM{|7&LEDI;r-^f=j}J+6aJiP{>M6ApwSA!Wy?It2UoGP^~Yh siQj~(0fH?X6qGW_?8B-}7gc-TUzTxL%ND)$$^ZZW07*qoM6N<$g0$5F_y7O^ literal 0 HcmV?d00001 diff --git a/textures/bitchange_minecoin_in_ground.png b/textures/bitchange_minecoin_in_ground.png new file mode 100644 index 0000000000000000000000000000000000000000..476573d7810a27b8dd6d426e43baa6d493f9735f GIT binary patch literal 366 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=G^tAk28_ZrvZCAbW|YuPggqW;PKOof`|-wg82sN?apKg7ec#$`gxH83GbB^Gfvm zTtgJfjP*?Q3=Isv6fFd*y6)-X7-Hd{{N%xdgasT8JPTM3o7&q?nf3is!Lj+r-7n29 zknHf~z0;r{o>jkp@2&s;-*(RVzk}z%GPZ|J%8^_1^-TWn-=$h;<|m#I=sfZNLBWR8 z+b(y@xXypWb^lvQ{Ga{Le+&1&pY?b_ldrBHbKG3byH(lIul|2GU-s{R-SXG}CqK^g z_b_^Jx_8%odH<<@>kIe&{r{c4_+PF4^mfyN!d(x(e*B_5U;pa=|0U_y_P4id|BH`* z{ClQ~xXirl^&cMjT$ty(hgqbf_ptS-seCF{VaT^XSj6l9=?>6~44$rj JF6*2UngFY8oZJ8a literal 0 HcmV?d00001 diff --git a/textures/bitchange_minecoinblock.png b/textures/bitchange_minecoinblock.png new file mode 100644 index 0000000000000000000000000000000000000000..8c801c100510d510e2a5463450243b4c2ec8cd6a GIT binary patch literal 404 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WSkfJR9T^xl_H+M9WCij$3p^r= z85sBufiR<}hF1enkiEpy*OmP)GnZCDgJ!;Rxf)e6?XPTDK_X0^KO zDhRA%mUQ9%opQqAh1{XX%nM!`-}Z2J&{c`vklm;-k>kazgISL0OJxLfXDhTk6J5aJ z!lmRlkzau=cShrerTuR~cd{e+;!WZ1KsK?Ex&?G`vVdW9EohD0jTb<{sopHE! ta25ilSaJYD@<);T3K0RV;Ckh=f? literal 0 HcmV?d00001 diff --git a/textures/bitchange_mineninth.png b/textures/bitchange_mineninth.png new file mode 100644 index 0000000000000000000000000000000000000000..43d968e963a29d2660b83d5c4a38785fe92c4c3b GIT binary patch literal 1146 zcmV-=1cm#FP)2fhOH2O*=_sYcigQ0N+2h^iF1bXV zc@6`6Z@>H9-S6&8tgZ0xD82V^eSLk?{xp$DT)lj~bG5>C@jh{KpPuD&sl1$D#eCYW zlrp|kETr9nb8s!ECpKHhHRnORn-^Hgg-_-DEEkX5Mm_I#I~BLzt%V-`);un_)pFK= z5zsGI1_8}-$+uGB&}}tKGY*F*4c9({UfpNYX_XB_fX`-WFJ2R=ETFDhgbOQr}==f!@XlyXb000XeG~h^&ZDRvM z`D{B|31P|W04G(q0c@~@s2cvyNvJ?IdH_sS(6?374X;qAc>^i#TcT!(x z#xcdnCaWWv576#ao!Z~2{KBy0{*PCDK@tAaKvL0+^Rtdw;c#ld2ejRI#x0~h3J?nev~dYQSgoU;Wp>028k29S_Q-;Z!-Cof zfJab>dT}ve7$!JELHU^j)%rk<{SsOR2)5H_+cuNTJ}eh>(X#jb1+RUVgi=28pa1{> M07*qoM6N<$g2A-?s{jB1 literal 0 HcmV?d00001 diff --git a/textures/bitchange_mineninth_in_ground.png b/textures/bitchange_mineninth_in_ground.png new file mode 100644 index 0000000000000000000000000000000000000000..9b54336d33bb6b9f3e9162e55a4211c09933ac37 GIT binary patch literal 364 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=G_YAk0{w5<>&kwYnN37R=f(oIEkGfu64!{5;QX|b^2DN4hJeJ(yb?V> z*ARs=V?9$nLj!{^MGJwdu6nvShFJI~Pnk3+X#qzA&jOairt$mhEZ;x-y1IT{{QgTV zryX*#9gnhI-QQpR**~-AE01O#ILuzYZJurMtN**Vum4y7=fgMq z3qSomj2@hQ{d~W??VjKNPfl+CzrXhHm-m_z)J`_+-kvX0`SH)m|NZj!|L!jQ`|7`P z`?q?agzoHX+6;ROnO{u$zdbMR|Avy2PSJbVdel@t6{|3WEMl@1pF7C_=s^ZgS3j3^ HP61#| literal 0 HcmV?d00001 diff --git a/textures/bitchange_moneychanger_front.png b/textures/bitchange_moneychanger_front.png new file mode 100644 index 0000000000000000000000000000000000000000..1465e709d1b439c5e611631fde0fb777882655a7 GIT binary patch literal 1321 zcmV+^1=jkBP)N2bPDNB8 zb~7$DE-^4L^m3s900gB;L_t(YOSP6yPa9Vh#fLVF_A69szd+ZODj|@_0zugz5Nud> z+Xc{AZJ>erU$8OQV;g7uZ^kyZAxcD{5Vc)o(XNuFQY$5G+KJY&3@o}fq>GgWuZkIWVB75blW{u%+$QgEYY%myTN3WX0FyvJS zxHa-#|N8wt_w|j_>~K_T?&~tIhJA8!qGPhFAuxU7ux6dtrx-xrH1Md`?L2CH_O$8g zdEB_&>xSk#0Gin$O28~Qn9xj!E`m6&aPL{)dwJ&l^JMgB@x1R1!X0@88#6OApS&4b zFD@=_Zf>?(Eg(-%Pw^d8jTivHPSlq5zprBJVCePNf!B$eB7r-wBy;6*IhjnZtgK8; zO{LRm9e|vXrE5N11W+tO@cpvvJ%9L~7H5avA7{5-oqHGck1Z>@Y>abpe}8{=c6MW9 zL$Bk0$Q4JC!WZdy{iHfF{rh9@vik1Ji(A_HIrJbJezjJ5O+PYvbaXU5JzXpo$rI5y z73qQ;eA;pV&xYQ)Kk-xG0q{#S0w8=O2p(VnudS^m5(#o3HN#{afwmO*dF#_x-;FSS zsJ-+0%6swX{U3t~QS{e^cUk`kTP8tM3!9o(S68>TwghIfRvb>IBZ_;`i=p@Wass04 z`EBS$VSryw&DU|5B7-29oSf851R9c-%Ylf)i+<~lF#f!Vt;=^=e;9p1>L3S}DXT)E z&~CT2^ZE5a2$q{0m8?5b@kqa&=J&yeB3;i_{ezQXM9JU*%u;Jws17ojjPLvAJ|V)S zjyV+AFL^D?xsuppTtDll9GNP=ES!?HuPGwtYrjM_ds>Kc;2BG9Zt!%M8=bQ}T9 zkbTqm_&K?(Pr#E29HK2PEiKh*HJF59{BQu|L>FlHm|(#t+AV@XLYie%j;B&7?pmG< z$;lKnKFA7EpX%<%Q{x)8xb`vrk)bh#QM7vScP9b*>X=&Jxwt04=l1Z8! zC2+9E0V;lGXL~c7x(mQTen(f(HzjF55)$MM0OV}J0!EW4757^81DVStzfvY19ObjA zuSHteEavxiF-oeeCJ4eMS@`n8&RHnblwK=-_CHA$UbURX335gg)GM9JCD{~BbOg&$ zYEA10wMx~`wws3}L%z#;J*b+55aD<)xFJ&lq?^mG&e2jR>^G&*5FsL6Pwsw9Jw6$k ztmQs2{ZAz$S#nG4FiSN2&0+_vbLbZ3N$9NIZ!)$pK?K&hxJkv)1MrSmwT4o#aUTm@ fi6hW|Z*Tkyr19wUG5r8c00000NkvXXu0mjfz$k34 literal 0 HcmV?d00001 diff --git a/textures/bitchange_moneychanger_side.png b/textures/bitchange_moneychanger_side.png new file mode 100644 index 0000000000000000000000000000000000000000..142397f3fe81744ccee7ec163ac7ad657906f3d7 GIT binary patch literal 320 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WSkfJR9T^xl_H+M9WCij$3p^r= z85sBufiR<}hF1enP^!c=q9iy!t)x7$D3u`~F*C13&(AePq0Cs%RL{`B;7id$psGEd zE{-7{-g~Eca~(2ZVEsC$iThwHcjrPeW+4?Jo}d;Fy*Ju>w0oHEo?DXn`DUM?nFd#l z;kApeU+%4ESW@cn$-H3;pU&w|OcSm#_Wt8kSj)V2D?3o=O4NIXOI871I~hG*H!OS3 z1(dLS&JC2v_;(&CF(JqbC~?5%ygNgt?2KhE8G!PJ$83S}Edpf>m;Sxx{gB`A-}Q&p zfpDXJ;tzLg*2z6km#R~Hyq)V$T+978A9k-a3+N2bPDNB8 zb~7$DE-^4L^m3s900f6gL_t(YOSRV5ZY4Pk1kjm3c7$`zIp>@coZtul-kwG^c#YY8 z+!1ga5+#vUMM}EAcXoDu{naMG!otGC!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top.png b/textures/bitchange_shop_top.png new file mode 100644 index 0000000000000000000000000000000000000000..5742be688988aab28ba6f18894ea7cc1172c1f2e GIT binary patch literal 2997 zcmV;m3rh5fP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGi!vFvd!vV){sAK>D02*{fSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@H7+qQF!XYv000X3NklV$v0fkR zb9|5QV>~`)JTvzAzSiEX_pbGAC*RGaa3?D{TM>V5PI335@j`oMg;H!}72w_@q#Lwi6&Lofsa{6VL3v9F-g;_c z6BC@Pi0R5)~4zrh$iAG?o5n$K6BLxSu=wuaL14S3B?irj9j4sC5z2xLJDcH*JkKz2^ zK7SkImB-iGNlD7g#4Y_K#3U`ul<7#`-dFbwbYk44IKPXFwrSN?R=!C}DR>-*2J>Ea z&NWQf2XQM4yhT|1bGH7HlQ|b0T|#(k8PN$^xk*YkGot+o9y_1U!)#Q4B%!}GW#~&9 zZUtA?+E;-`S|QHS2zNOtK9N_i&O6c$PqYFPiy_XX z2j&>BKeKbHI@=6!Dd%XxKS9H6+BHnOhAO_1R)n*Ja#vGRn;GFwNq&1%bGoDgiY+FE zC7_afEazsEZqB}Fj-i@wxD{b9q7&WJR5vZ$qE+Wt9Irm!WBlZat)05Dn~`=2={!1F z4REUdk(z%D7_gS)t)(WnGJ;ci@m@)Ol9mE&7UF_tgje#9H^RI&!mkC#t3h@nIMxo0 zb(7pWIY7>9k2K~CGS|# zGm>`?5fBqM_vP%&if5?d8=Vi2F948m@fNjD5lAuPg$IweQE|q~0*qp27I?r+M+gfu z=NxN<$LE3^K+y)N=*0LH?^wY-l5>vaTqD4wtYaW$?2Bp-r;SG_h*@+Efnu=44l3y3 z;%-XZOYlL+7(f2zMkOG?%`D8!Oqf|Q&Ebgpa2Dnjyj;>UkhcxDLK9V(U3Cwa+#|SU zkamrNi-ZQk)3>Bd0}11PTWKSUf(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{k8GzqBJ3@sHsD@9K$V=Kq>rHKBz2S5AvaRxXWR>f_Ss7a83L`f@v zT8Nm1DZ3Ogh%zo^`oEeMViwG;EFu;F1p-MTW>M6@kLr0*14xeubI5Urg7VG~p6Tlz z{Ng(&z*ezajF|{vvK6>0BHYrLMF8Bx9I_ldO}UjvG3P?Y4U)N0@RkruDPaQle9VA3 z<-lG51;8)ulv4mUzZP801k_47t|$5B$5t7?eD)O3G-2g|WMLk#|4b%K-1sazpdN~9 z$APAlTQ(QhgJhnpg$h9ps08(ChmeHjfa&Y?G2Mtq-v58~Ajx1KV*KN^`+oJ^(;yKb zb$|T9xt~9^4GuFvw_ktn3|QR%?ttja53fCYe+T>pj#A*2%MW*-y0?A#kuFFQIG%t; rfAo#Dzy9#^plk3900pCiQ^kJ(-~sY$5QiH700000NkvXXu0mjf-+!9= literal 0 HcmV?d00001 diff --git a/textures/bitchange_warehouse_front.png b/textures/bitchange_warehouse_front.png new file mode 100644 index 0000000000000000000000000000000000000000..40e60356d7ac8b3abd55e4b5733cc0cd68c9bf9e GIT binary patch literal 903 zcmV;219<$2P)2>Oh5Wa` z?#<|4F1nwK9V`kC7h^|xLAwy^*f=i6*qm%pHfpzI^p*tuvSF3wf(85v5^uO7aOc`p zb?f>&5qP#BC1MdpAZry}kdB#p2I?|pnUZ{D4eR-p2;`#hxK*0SfV=36Kv60SJJEUR ztb55`GY$I9^x%Hd9`7P10u^Zt*;4~b9V$QtsUy{-L}Wk(h!HLrtq1AOo+f|?Siw3Gs7RHm1Jv!^CyICf>9&IU$o+03%`z5ijpQ$pG70v7~Ze>O`xE^k0Fp||w(WfvY zX#})J!t!5kCw^?sf8U({wgD1fH{=fBE1VW)B#nU9NNgxY_jx_>X+6O?N*$%R57;YV zM$!uejRcEJcfKl&a+I$g~qlBcL@>kdBZk3#C`XN}cS26G3c?%E4zJtc71#(bEiPJu^HzA)6pWi@ylze{Mh(FUsGH-u z5%>K5J<+gkhBb3!F{lRM5LALl;Ljb+BkEUz15gh3E%r)+UTGqbF73HQaAhK@AYIx# zNArlD5J;EyT%tt+AKtwBS9EC}$XEV{08uOnQ3d>29;8J}vJb6P@c#8nR-f|T=QVG) z;C(50UyFiX(cdfi`=IO}l>L6$KdcA_RsX2!4{IPet}(Q7m;D^yPPH2HNMJiJ?2c3! z`xC|qsW6_@1*3X!+K>fe?Bw7s0{LW?F@aUF&?|aSr)?_Zs3D}|MsT(sfh&}P4{F69 zZAf%`D!`4MHR%iu8B~0A>KMnC@w^#a2+U>6T(u1UqDP}JL?`L(&JzN82>>q~;24J; zsWO7=4RZt9vOtV#GzM&G42vqDK*~gbk|~^?AP|wZ&28Jz zX%Wu=L9vhBM8`=4V1Wz9hfes|3BPs2@7<6!dT6r&ADVM!3^M{$hXpD{084}m8o-VG_ zKq_$Kra8yQEkl6YY|@-{+%yKuI3;BQ(B>{V(IOc)a<=0Z&pAUNIc~8xk7FboCB*^F zAppw7kd0yHwVELyuT>iZv!mlCHZ7wgRYoOc?AZx5Mbje5xiEdLW(mxWTiT|ODr1aP zze4CO>^vrJ+%g2FuT>iZomHDKI-Ba$F;X$4w4VH+Ui6si5Ngh_s7)4*ky&*%g;W`5 fNi!yyLY9Z$Hjy#VJJz`i00000NkvXXu0mjfLP(mF literal 0 HcmV?d00001 diff --git a/textures/bitchange_warehouse_top.png b/textures/bitchange_warehouse_top.png new file mode 100644 index 0000000000000000000000000000000000000000..c3558ebf61e7c43cd827c015ca76014f0612fe7c GIT binary patch literal 1406 zcmV-^1%djBP)Ql;h_im2jHj63wJL)e(U_OyV6_u{Pq2l7Tfc|`iHk4y?bfl&c);3zjear;l|*| z=FM~cw{IN#@tw!KJzu^uv-#bdkFayF-jgpDc<=v@kDjr0>->zIgZ;J6*)Q)s`P&Ci z-@Eb@9s9R0%xpUKFtNW@Ot9|F8*kWKOFj65_2Js--Vuiy0BPSpzx#yu&2t00d#k)F zzFa@kfAe||3=EeEfPuHWGQg&?x!CV4cWl{YhaVPXAhFW`94AF|NRVTWJ8{J4{#r>3 zA1%ChS32*iwLtRTl~Yc?dX@XqFeFQ|&7lUss1Md1L}Gi+aaK;ocQDsZcf^=*#5yrP zrUv$jQ3rYBY!{#G5NH6<4mUbm9C7SXl9bW9;tjIQ9J}@*{lI!YN0n<7rO?)N+^M^9NbwhWe^H!n?lAs z``%I~8gBxu+l)i}V-%eZ*1Nscjt59jy#b_~#6_AK*GT{K=?h$7h-(b-U~jeLjW@6f zK%zo`E=fD7QyN9yCKjbBs%zcWQimsw*|o@iDla*AE|$(p{h_kXxf)y{Pi>=KeCi*M zTLjGUI+5z2FjX{_DxHU>2tul&HZPr(t`58%93en4VMm%~eMw66OdS2$7IurMN%iooHp*fmT(YminaVP(*C>`I zO$|~y$9zw1x#KN~LCs7hlTLPe<7_Vue$Wc>BXBg;+d!LAl#)6QXIKfT?SPS)6q%Sb zhB=w6H7AAQ*>RdW$Hggv5YamwpO|C=&FgI{YDF%Oqw&d1PJTEf&%ksH(+O^xrT{DR zx>PIxxmCui7+5kMMz9`3f^f4EOB2}1KxC=`03V~aW+(%^GP(@fG>Y|@G^EU_9ReIO zDpF)D%BAbw07&pFeW;!mAy1OdP`o>$e=(h2#Ut#nqzSYVx_4Iuii)1!t|k21|G zL8lZ+pv+{N8oJ5y*vxv<4r~e39CaQa0pyO&@S>mJDb^q(Cn4#NP*cG}ffRsbdfpIA zK5Yulev5!YDw$v{(h$O=mi`lqXIv&-)9<1TuZ*qaHv=P7$$XA$ zAyS_4l1V>0tzqe*a=A`L7I=QxsMshvat2dVkIaU^5Ke!%<`^a5Cm#2yqf@;b%5^*a zbWB7_G`i+a=13Yi3AD&(8I$uu_6!&RI<(#>Ww7UF)C3a%oCo*Z2O{1V;QGPU0{{R3 M07*qoM6N<$f`BK3E&u=k literal 0 HcmV?d00001 diff --git a/textures/moreores_mineral_tin.png b/textures/moreores_mineral_tin.png new file mode 100644 index 0000000000000000000000000000000000000000..591920c64f2b5c9e30abce8565a39495edbbcca1 GIT binary patch literal 254 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*K0-AbW|YuPgg)9!?=%E;k;QE}&4Ir;B5V#p&dP z1!gzOzhC%YTh9M?`Rs)~Eha@9HW){ooNa7mU|=9qUGeFEzrDSr1Q5)b@>U{{$6*_z zn&l6MZ5s}}Vl6pv@KE0&cRqHW{c_b6LPr%M7%uS`Bo*6L>Acxp{lb3TjKm}22{#Ts qI6i;=mEN>2VIk#}FB@L16lJLT=4$w{OlcR;B@CXfelF{r5}E+*=~tux literal 0 HcmV?d00001 diff --git a/textures/moreores_tin_block.png b/textures/moreores_tin_block.png new file mode 100644 index 0000000000000000000000000000000000000000..e28c371c10cbee94543d0ce3daad141ea30be59f GIT binary patch literal 269 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=DinK$vl=HlH+5kiEpy*OmP)lZXhjc!}KWK%mepPZ!4!i_=Sk422FGa4eqle?e#C z$^ZXduAiA}RC0bP0l+XkK^C^-Yf1IQ%_c zeD1p}AN#-hX7|a{{7~W1OvOnd_SEfPd46vzVP;5p{0?>Uf1Ng zy3YH&@g|3Mga_w=s@<#`7MYx$;VQ@=d!Ic){J4+0aP=no-U3d7N_q{+Us}NK%{m5goM=7 zn@e4_s@wVA$Xb;=mps)Ia&4bat5S{mn@pZw{(ZuBy6X4M zH#?tYycJmTGi0?LK-){(IWrFRRuSo>Od5hzopr E0BZ7@`2YX_ literal 0 HcmV?d00001 diff --git a/textures/technic_mineral_zinc.png b/textures/technic_mineral_zinc.png new file mode 100644 index 0000000000000000000000000000000000000000..598efebf47c51eda10ad021b0c971e7b4d7cb1ae GIT binary patch literal 891 zcmV->1BCpEP)Yn#+0o+M39a!!`~y%-Hnn7_OC z<$d3W=Y>bSG5Hqrv-A9y;0lerY0?&L!ri@e`M|2z$mdF^0j)EqT)BLabx)3wE#--+ z8e0y&DgjQOm=qo_h_;)nH)e4A{g_sTQDY^k>%U_RBJ-hJ-`?skhMt4=zd=K1l>{B-Ut(Ori+R>lVPj-_8`vn-tYQ~6U(_sCWjCc6BDG; zH+XvOdNyo$h6|TwNX@2LvvwWj;$O6+i-4xFSj=G<2^`C!S+jBb-1PNE_y>;{HadMa Rlk@-p002ovPDHLkV1l46q=Nte literal 0 HcmV?d00001 diff --git a/textures/technic_zinc_block.png b/textures/technic_zinc_block.png new file mode 100644 index 0000000000000000000000000000000000000000..5ae7947200a2089e45ff398202d50c3072ccf782 GIT binary patch literal 681 zcmV;a0#^NrP)Wab7zW^Xz8Q}vw)0ar2_fO9f)pyTfNpyMHXMK@cj6FiS+T2x#F7PKfshKcBBi8F zOWMSa?HP|}Sip0IhaJ3rtCyDmIOk2%#J484$Ze7HR%|zGMw}4?BX}34w*Uy@;??tm zUn|>><>_j(yWOfRk%zWTDEQB;+)cwpZUF#ze>5X~HDBcR!_f(VQ9G(Eg`NRux0qmV zl&Gxqr|a_Y>j?l`79zTRuXg_BvptXIcW%ZVb*VJ~Yp5?pKmhUmVS9hrJ}c^`+)y!} z1;hYYPY+UgvC$nRSGpd@wA2QG63&1=Uu{BSG96N|H8{()W*$JMJuxWZ9(G%w&Nn?J z$s^MqKrC1H2 zwuD<$mSEGC)XPf(@O_z^20L5H&#b&GGzplR3hSo5=*wb70ym}UDA`v+bW?K9P17U_ zMWO8|QO@IdX&ghs$$;*5T3PA$1`+vxbs!lhO1RmoNTdiEYZ^c9C?(vYFyzru^5{Bu z7J|8xOp8F0s||p0ECF1UI+3)l%(B8H3LS$Ij)<%$5(tTV*O2U{m8HY4Co*u%vt?;| zq5M<)pZT@2Pqy1f*ZG@|-|ln;6M-n^GfYP>o<1@)n?xb&3RB~LyQQ5E8SBT=0n;>@ zrjIKNeKi+6>Aw4Z4!}1}on0ePoO1wmz6!Sn<;5viahMK@`Anum+3WuW%FRD$#7Vv# P00000NkvXXu0mjf65}?B literal 0 HcmV?d00001 diff --git a/textures/technic_zinc_ingot.png b/textures/technic_zinc_ingot.png new file mode 100644 index 0000000000000000000000000000000000000000..9f9eb2c1554dbb80854aa85ff3606f120d2525df GIT binary patch literal 317 zcmV-D0mA-?P)-bQ1g#)yDAnk~q<4rMSPj7AKf(G60_6J^-Ak(uUD;4L~;v0a$Ev2Rp$k z+tKfJT*KrwrBIq(rQFU38?P`N&uzcgp{%tN#Cg#Owq`h<+q;J+%W>ozC0T~?E7h$K P00000NkvXXu0mjfiyw!2 literal 0 HcmV?d00001 diff --git a/textures/technic_zinc_lump.png b/textures/technic_zinc_lump.png new file mode 100644 index 0000000000000000000000000000000000000000..1a620ab5c6fe278c1a8803e4ffb7d57819d5fd37 GIT binary patch literal 308 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkQ1F?j zi(`nz>ARDx{SG?_wC#^o4|vMtv1O%FU@@aq*1L(!PdGRVCA~BzGY33WN^M{YT66H5 zU7F?vt8J~Rfrm^MUwrfbZ1%(Rv!%Rja^jPhiMD=?Ip=?6Jwy3VJtmpdS(jKDvh-tg z{jO>#bo#zMImM~N_ub79o%7FSd;hIu4z8ZV5y~NQEx9?N*}!^U!S0jEzuzv2uZ_1% z>hbw%Zv9j7HN!nSUB4xr%cIOU@;0rswGQTEwwt4_d%lfXqu1b;WAue@FNO47TYF+3 zrv1I5^K$Q&xu=+7;^(ZqSifOcea~Ayp+)-t)W5Nc+^onsStyVJ^f7~{tDnm{r-UW| Ds0Dci literal 0 HcmV?d00001 diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..38f947c --- /dev/null +++ b/version.txt @@ -0,0 +1,73 @@ +======>- Version 1.6.6 -<====== +- default config 'config.default.txt' +- generation adjustments (coins are alot cheaper now) +- recommended: enable converting of gold +- new item: "Coin base" to burn into a MineNinth +- changed some codes in the converting + * 'HELP_ME.txt' for more information + +======>- Version 1.6.5u1 -<====== +- read more in 'config.txt' how to configure it +- added currency support for bank +- added money2 support for bank + +======>- Version 1.6.5 -<====== +- initial money +- 32px textures updated +- money exchange rate optimized (needs a bugtest) +- added a bank (depends on money mod) + +======>- Version 1.6.2 -<====== +- some graphic edits +- editable exchange shop title + +======>- Version 1.6.0 -<====== +- 32px textures +- fixed money changer bug +- some generation rarity changes +- mineninths now digable below -32 + +======>- Version 1.5.5 -<====== +- added converting gold into MineCoins +- MineNinths now also can be found under -64m +- putted together 'crafting.lua' and 'minecoins.lua' +- added 'config.txt' +- some fixes + +======>- Version 1.5.0 -<====== +- added 'HELP_ME.txt', name sais all +- pipework support for the exchange shop +- pipework support for the warehouse + +======>- Version 1.4.0 -<====== +- built shop.lua from scratch +- added warehouse.lua for people which have troubles with the space + * enable the warehouse in init.lua + +======>- Version 1.3.0 -<====== +- fixes in moneychanger.lua +- added moneychanger.lua (might still contain fails) + +======>- Version 1.2.0 -<====== +- changed some textures +- serval bigfixes +- added converting moreores:tin to MineCoin Ninths +- added converting technic:zink to MineCoin Ninths +- added generation of zink and tin + * enable the support for zinc and/or zinc in moreores.lua + +======>- Version 1.1.0 -<====== +- modifed parts of generation +- renamed Bitcoins to MineCoins +- destroyed all existing "Bitcoins" by setting them a new name +- about 30 letters of new codes + +======>- Version 1.0.0 -<====== +- first release +- exteneded stack limit for bitcoins to 30'000 +- bigger stocks in the exchange shop +- ore generation added/replaced +- Bitninth added +- copied "Currency and Economy" from: https://forum.minetest.net/viewtopic.php?pid=106971#p106971 +- copied "Bitcoins" mod from: https://forum.minetest.net/viewtopic.php?pid=119354#p119354 +=============================== diff --git a/warehouse.lua b/warehouse.lua new file mode 100644 index 0000000..3ebc421 --- /dev/null +++ b/warehouse.lua @@ -0,0 +1,148 @@ +--Created by Krock for the BitChange mod +-- Something like a chest...experimental, have fun! +--License: WTFPL + +function has_locked_chest_privilege(meta, player) + return (player:get_player_name() == meta:get_string("owner")) +end + +function get_warehouse_tube_config(mode) + if(bitchange_warehouse_pipeworks) then + if(mode == 1) then + return {cracky=1, level=2, tubedevice=1, tubedevice_receiver=1} + else + return { + insert_object = function(pos, node, stack, direction) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + if(inv:room_for_item("main",stack)) then + return inv:add_item("main",stack) + else + return inv:add_item("main2",stack) + end + end, + can_insert = function(pos, node, stack, direction) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + if(inv:room_for_item("main",stack)) then + return true + else + return inv:room_for_item("main2",stack) + end + end, + input_inventory="main", + connect_sides = {left=1, right=1, back=1, top=1, bottom=1} + } + end + else + if(mode == 1) then + return {cracky=1, level=2} + else + return { + insert_object = function(pos, node, stack, direction) + return false + end, + can_insert = function(pos, node, stack, direction) + return false + end, + connect_sides = {} + } + end + end +end + +minetest.register_node("bitchange:warehouse", { + description = "Warehouse (Locked)", + tiles = {"bitchange_warehouse_top.png", + "bitchange_warehouse_top.png", + "bitchange_warehouse_side.png", + "bitchange_warehouse_side.png", + "bitchange_warehouse_side.png", + "bitchange_warehouse_front.png"}, + paramtype2 = "facedir", + groups = get_warehouse_tube_config(1), + tube = get_warehouse_tube_config(2), + legacy_facedir_simple = true, + sounds = {name="default_hard_footstep", gain=1.0}, + after_place_node = function(pos, placer) + local meta = minetest.get_meta(pos) + meta:set_string("owner", placer:get_player_name() or "") + meta:set_string("infotext", "Warehouse (owned by ".. + meta:get_string("owner")..")") + end, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", "size[12,10;]".. + "label[0,0;Warehouse]".. + "label[2,0;Layer:]".. + "button[3,0;1,1;inv_lv2;1]".. + "label[4,0;Workspace:]".. + "list[current_name;worksp;6,0;5,1;]".. + "list[current_name;main;0,1;12,4;]".. + "list[current_player;main;2,6;8,4;]") + meta:set_string("infotext", "Warehouse (constructing)") + meta:set_string("owner", "") + local inv = meta:get_inventory() + inv:set_size("main", 12*4) + inv:set_size("worksp", 5*1) + inv:set_size("main2", 12*4) + end, + can_dig = function(pos,player) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + return inv:is_empty("main") and inv:is_empty("main2") and inv:is_empty("worksp") + end, + allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + local meta = minetest.get_meta(pos) + if not has_locked_chest_privilege(meta, player) then + return 0 + end + return count + end, + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + if not has_locked_chest_privilege(meta, player) then + return 0 + end + return stack:get_count() + end, + allow_metadata_inventory_take = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + if not has_locked_chest_privilege(meta, player) then + return 0 + end + return stack:get_count() + end, + on_receive_fields = function(pos, formname, fields, sender) + local meta = minetest.get_meta(pos) + if(fields.inv_lv1) then + meta:set_string("formspec", "size[12,10;]".. + "label[0,0;Warehouse]".. + "label[2,0;Layer:]".. + "button[3,0;1,1;inv_lv2;1]".. + "label[4,0;Workspace:]".. + "list[current_name;worksp;6,0;5,1;]".. + "list[current_name;main;0,1;12,4;]".. + "list[current_player;main;2,6;8,4;]") + end + if(fields.inv_lv2) then + meta:set_string("formspec", "size[12,10;]".. + "label[0,0;Warehouse]".. + "label[2,0;Layer:]".. + "button[3,0;1,1;inv_lv1;2]".. + "label[4,0;Workspace:]".. + "list[current_name;worksp;6,0;5,1;]".. + "list[current_name;main2;0,1;12,4;]".. + "list[current_player;main;2,6;8,4;]") + end + end, +}) + +minetest.register_craft({ + output = 'bitchange:warehouse', + recipe = { + {'default:chest_locked', 'bitchange:minecoinblock', 'default:chest_locked'}, + {'default:chest_locked', 'default:mese', 'default:chest_locked'}, + {'default:chest_locked', 'default:chest_locked', 'default:chest_locked'} + } +}) \ No newline at end of file