Commit 84f1b0f3 authored by SmallJoker's avatar SmallJoker

💥 Break old settings

- Rename bitchange_ -> bitchange.
- Better coding style
- Run OptiPNG
parent 20fcf0a0
......@@ -87,21 +87,21 @@ minetest.register_node("bitchange:bank", {
end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
local meta = minetest.get_meta(pos)
if bitchange_has_access(meta:get_string("owner"), player:get_player_name()) then
if bitchange.has_access(meta:get_string("owner"), player:get_player_name()) then
return count
end
return 0
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if bitchange_has_access(meta:get_string("owner"), player:get_player_name()) then
if bitchange.has_access(meta:get_string("owner"), player:get_player_name()) 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 bitchange_has_access(meta:get_string("owner"), player:get_player_name()) then
if bitchange.has_access(meta:get_string("owner"), player:get_player_name()) then
return stack:get_count()
end
return 0
......
-- General configuration - BitChange
-- Created by Krock
bitchange_initial_give = 2
bitchange.initial_give = 2
-- Enable/Disable whole nodes
bitchange_enable_exchangeshop = true
bitchange_enable_moneychanger = true
bitchange_enable_warehouse = false
bitchange_enable_toolrepair = true
bitchange_enable_donationbox = true
bitchange.enable_exchangeshop = true
bitchange.enable_moneychanger = true
bitchange.enable_warehouse = false
bitchange.enable_toolrepair = true
bitchange.enable_donationbox = true
-- Set this variable to false if you have a supported currency enabled
-- and if you want to disable the exchanging/converting point - the bank
-- Supported: money (by kotolegokot), money2 (by Bad Command), currency (by Dan Duncombe)
bitchange_enable_bank = false
bitchange.enable_bank = false
-- Converting other ores to MineCoins
-- Tin moreores
-- Zinc technic_worldgen
-- Quartz quartz
bitchange_use_moreores_tin = false
bitchange_use_technic_zinc = false
bitchange_use_quartz = false
bitchange.use_moreores_tin = false
bitchange.use_technic_zinc = false
bitchange.use_quartz = false
-- Pipeworks support
bitchange_exchangeshop_pipeworks = false
bitchange_warehouse_pipeworks = false
bitchange.exchangeshop_pipeworks = false
bitchange.warehouse_pipeworks = false
-- Advanced generation settings
-- Change in 'minecoins.lua', starting at line 101
bitchange.enable_generation = true
\ No newline at end of file
......@@ -48,7 +48,7 @@ minetest.register_node("bitchange:donationbox", {
local inv = meta:get_inventory()
if not inv:is_empty("main") then
return false
elseif bitchange_has_access(meta:get_string("owner"), player:get_player_name()) then
elseif bitchange.has_access(meta:get_string("owner"), player:get_player_name()) then
return true
end
return false
......@@ -59,9 +59,9 @@ minetest.register_node("bitchange:donationbox", {
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
return stack:get_count()
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if(not bitchange_has_access(meta:get_string("owner"), player:get_player_name())) then
if not bitchange.has_access(meta:get_string("owner"), player:get_player_name()) then
return 0
end
return stack:get_count()
......@@ -69,10 +69,10 @@ minetest.register_node("bitchange:donationbox", {
})
minetest.register_craft({
output = 'bitchange:donationbox',
output = "bitchange:donationbox",
recipe = {
{'default:wood', '', 'default:wood'},
{'default:wood', 'bitchange:minecoin', 'default:wood'},
{'default:wood', 'default:wood', 'default:wood'}
{"default:wood", "", "default:wood"},
{"default:wood", "bitchange:minecoin", "default:wood"},
{"default:wood", "default:wood", "default:wood"}
}
})
\ No newline at end of file
......@@ -3,7 +3,7 @@ bitchange = {}
bitchange.mod_path = minetest.get_modpath("bitchange")
local world_path = minetest.get_worldpath()
if freeminer then
if rawget(_G, "freeminer") then
minetest = freeminer
end
......@@ -27,22 +27,22 @@ end
dofile(bitchange.mod_path.."/minecoins.lua")
dofile(bitchange.mod_path.."/moreores.lua")
if bitchange_enable_exchangeshop then
if bitchange.enable_exchangeshop then
dofile(bitchange.mod_path.."/shop.lua")
end
if bitchange_enable_moneychanger then
if bitchange.enable_moneychanger then
dofile(bitchange.mod_path.."/moneychanger.lua")
end
if bitchange_enable_warehouse then
if bitchange.enable_warehouse then
dofile(bitchange.mod_path.."/warehouse.lua")
end
if bitchange_enable_toolrepair then
if bitchange.enable_toolrepair then
dofile(bitchange.mod_path.."/toolrepair.lua")
end
if bitchange_enable_donationbox then
if bitchange.enable_donationbox then
dofile(bitchange.mod_path.."/donationbox.lua")
end
if bitchange_enable_bank then
if bitchange.enable_bank then
local loaded_bank = false
for i, v in ipairs({"money", "money2", "currency"}) do
if minetest.get_modpath(v) then
......@@ -61,13 +61,13 @@ 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)
player:get_inventory():add_item("main", "bitchange:mineninth "..bitchange.initial_give)
end)
end
-- Privs
minetest.register_privilege("bitchange", "Can access to owned nodes of the bitchange mod")
function bitchange_has_access(owner, player_name)
function bitchange.has_access(owner, player_name)
return (player_name == owner or owner == "" or minetest.get_player_privs(player_name).server or minetest.get_player_privs(player_name).bitchange)
end
......
......@@ -40,19 +40,19 @@ minetest.register_node("bitchange:minecoinblock", {
is_ground_content = true,
groups = {cracky=2},
sounds = default.node_sound_stone_defaults(),
stack_max = 30000,
stack_max = 30000,
})
minetest.register_craftitem("bitchange:minecoin", {
description = "MineCoin",
inventory_image = "bitchange_minecoin.png",
stack_max = 30000,
stack_max = 30000,
})
minetest.register_craftitem("bitchange:mineninth", {
description = "MineNinth",
inventory_image = "bitchange_mineninth.png",
stack_max = 30000,
stack_max = 30000,
})
minetest.register_craftitem("bitchange:coinbase", {
......@@ -62,56 +62,58 @@ minetest.register_craftitem("bitchange:coinbase", {
-- Crafting
minetest.register_craft({
output = 'bitchange:minecoinblock',
output = "bitchange:minecoinblock",
recipe = {
{'bitchange:minecoin', 'bitchange:minecoin', 'bitchange:minecoin'},
{'bitchange:minecoin', 'bitchange:minecoin', 'bitchange:minecoin'},
{'bitchange:minecoin', 'bitchange:minecoin', 'bitchange:minecoin'},
{"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',
output = "bitchange:minecoin 9",
recipe = {
{'bitchange:minecoinblock'},
{"bitchange:minecoinblock"},
}
})
minetest.register_craft({
output = 'bitchange:minecoin',
output = "bitchange:minecoin",
recipe = {
{'bitchange:mineninth', 'bitchange:mineninth', 'bitchange:mineninth'},
{'bitchange:mineninth', 'bitchange:mineninth', 'bitchange:mineninth'},
{'bitchange:mineninth', 'bitchange:mineninth', 'bitchange:mineninth'},
{"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',
output = "bitchange:mineninth 9",
recipe = {
{'bitchange:minecoin'},
{"bitchange:minecoin"},
}
})
-- Cooking
minetest.register_craft({
type = 'cooking',
type = "cooking",
recipe = "bitchange:coinbase",
output = "bitchange:mineninth",
})
minetest.register_craft({
type = 'cooking',
type = "cooking",
recipe = "default:goldblock",
output = "bitchange:minecoinblock 2",
})
minetest.register_craft({
type = 'cooking',
type = "cooking",
recipe = "bitchange:minecoinblock",
output = "default:gold_ingot 4",
})
-- Generation
if bitchange.enable_generation then
minetest.register_ore({
ore_type = "scatter",
ore = "bitchange:minecoin_in_ground",
......@@ -143,4 +145,5 @@ minetest.register_ore({
clust_size = 7,
height_max = 28000,
height_min = -255,
})
\ No newline at end of file
})
end
\ No newline at end of file
......@@ -22,104 +22,86 @@ moneychanger.update_fields = function(pos, listname, index, stack, take)
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
if take then
stack_real_count = stack_inv:get_count() - stack:get_count()
else
if(stack_inv:get_name() ~= "") then
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
if listname == "rest" then
return stack:get_count()
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
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
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
return stack:get_count()
elseif stack_real_count == 0 and stack_src:get_count() > 0 then
return stack:get_count()
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
elseif listname == "output" and stack_rest:get_count() == 0 then
if stack_src:get_count() < 1 then
if stack:get_count() > 0 then
return stack:get_count()
end
inv:set_list("source", { "" })
else
if(stack_src_name ~= "") then
if(stack_name == "bitchange:minecoinblock" and stack_src_name == "bitchange:minecoin") then
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
if amount_left > 0 then
inv:set_list("source", { stack_src_name.." "..amount_left })
else
inv:set_list("source", { "" })
end
if(index == 1) then
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
return stack:get_count()
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
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
return stack:get_count()
elseif (stack_name == "bitchange:minecoin" and stack_src_name == "bitchange:minecoinblock") or
(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
if amount_left > -1 then
inv:set_list("source", { stack_src_name.." "..math.floor(amount_left) })
if(rest_count > 0) then
if rest_count > 0 then
inv:set_list("rest", { stack_name.." "..rest_count })
else
inv:set_list("rest", { "" })
end
if(index == 1) then
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
return stack:get_count()
end
end
end
end
elseif(listname == "rest") then
canMove = true
end
if(canMove) then
return stack:get_count()
end
return 0
end
......@@ -150,17 +132,19 @@ minetest.register_node("bitchange:moneychanger", {
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if(not bitchange_has_access(meta:get_string("owner"), player:get_player_name())) then
if not bitchange.has_access(meta:get_string("owner"), player:get_player_name()) then
return 0
end
if(listname == "source") then
if listname == "source" then
local stack_name = stack:get_name()
local inv = meta:get_inventory()
local inv_stack = inv:get_stack(listname, index)
if(inv_stack:get_name() ~= "") then
if inv_stack:get_name() ~= "" then
return 0
end
if(stack_name == "bitchange:mineninth" or stack_name == "bitchange:minecoin" or stack_name == "bitchange:minecoinblock") then
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)
end
end
......@@ -168,7 +152,7 @@ minetest.register_node("bitchange:moneychanger", {
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if(bitchange_has_access(meta:get_string("owner"), player:get_player_name())) then
if bitchange.has_access(meta:get_string("owner"), player:get_player_name()) then
return moneychanger.update_fields(pos, listname, index, stack, true)
end
return 0
......@@ -176,7 +160,7 @@ minetest.register_node("bitchange:moneychanger", {
can_dig = function(pos, player)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if(bitchange_has_access(meta:get_string("owner"), player:get_player_name())) then
if bitchange.has_access(meta:get_string("owner"), player:get_player_name()) then
return inv:is_empty("source") and inv:is_empty("output") and inv:is_empty("rest")
end
return 0
......
--Created by Krock
--License: WTFPL
if bitchange_use_moreores_tin and minetest.get_modpath("moreores") then
if bitchange.use_moreores_tin and minetest.get_modpath("moreores") then
minetest.register_craft({
output = "bitchange:coinbase 18",
recipe = {
......@@ -12,7 +12,7 @@ if bitchange_use_moreores_tin and minetest.get_modpath("moreores") then
})
end
if bitchange_use_technic_zinc and minetest.get_modpath("technic_worldgen") then
if bitchange.use_technic_zinc and minetest.get_modpath("technic_worldgen") then
minetest.register_craft({
output = "bitchange:coinbase 8",
recipe = {
......@@ -23,7 +23,7 @@ if bitchange_use_technic_zinc and minetest.get_modpath("technic_worldgen") then
})
end
if bitchange_use_quartz and minetest.get_modpath("quartz") then
if bitchange.use_quartz and minetest.get_modpath("quartz") then
minetest.register_craft({
output = "bitchange:coinbase",
recipe = {
......
......@@ -50,7 +50,7 @@ local function get_exchange_shop_formspec(number,pos,title)
end
local function get_exchange_shop_tube_config(mode)
if bitchange_exchangeshop_pipeworks then
if bitchange.exchangeshop_pipeworks then
if mode == 1 then
return {choppy=2, oddly_breakable_by_hand=2, tubedevice=1, tubedevice_receiver=1}
else
......@@ -231,7 +231,7 @@ minetest.register_on_player_receive_fields(function(sender, formname, fields)
if err_msg ~= "" then
minetest.chat_send_player(player_name, "Exchange shop: "..err_msg)
end
elseif bitchange_has_access(shop_owner, player_name) then
elseif bitchange.has_access(shop_owner, player_name) then
local num = 0
if fields.vcustm then
num = 2
......@@ -301,12 +301,12 @@ minetest.register_node("bitchange:shop", {
end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
local meta = minetest.get_meta(pos)
if bitchange_has_access(meta:get_string("owner"), player:get_player_name()) then
if bitchange.has_access(meta:get_string("owner"), player:get_player_name()) then
return count
end
return 0
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
if player:get_player_name() == ":pipeworks" then
return stack:get_count()
end
......@@ -315,18 +315,18 @@ minetest.register_node("bitchange:shop", {
return 0
end
local meta = minetest.get_meta(pos)
if bitchange_has_access(meta:get_string("owner"), player:get_player_name()) and
if bitchange.has_access(meta:get_string("owner"), player:get_player_name()) 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)
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
if player:get_player_name() == ":pipeworks" then
return stack:get_count()
end
local meta = minetest.get_meta(pos)
if bitchange_has_access(meta:get_string("owner"), player:get_player_name()) or listname == "cust_ej" then
if bitchange.has_access(meta:get_string("owner"), player:get_player_name()) or listname == "cust_ej" then
return stack:get_count()
end
return 0
......
textures/bitchange_bank_front.png

988 Bytes | W: | H:

textures/bitchange_bank_front.png

909 Bytes | W: | H:

textures/bitchange_bank_front.png
textures/bitchange_bank_front.png
textures/bitchange_bank_front.png
textures/bitchange_bank_front.png
  • 2-up
  • Swipe
  • Onion skin
textures/bitchange_bank_side.png

619 Bytes | W: | H:

textures/bitchange_bank_side.png

497 Bytes | W: | H:

textures/bitchange_bank_side.png
textures/bitchange_bank_side.png
textures/bitchange_bank_side.png
textures/bitchange_bank_side.png
  • 2-up
  • Swipe
  • Onion skin
textures/bitchange_minecoin.png

1003 Bytes | W: | H:

textures/bitchange_minecoin.png

760 Bytes | W: | H:

textures/bitchange_minecoin.png
textures/bitchange_minecoin.png
textures/bitchange_minecoin.png
textures/bitchange_minecoin.png
  • 2-up
  • Swipe
  • Onion skin
textures/bitchange_minecoinblock.png

404 Bytes | W: | H:

textures/bitchange_minecoinblock.png

354 Bytes | W: | H:

textures/bitchange_minecoinblock.png
textures/bitchange_minecoinblock.png
textures/bitchange_minecoinblock.png
textures/bitchange_minecoinblock.png
  • 2-up
  • Swipe
  • Onion skin
textures/bitchange_mineninth.png

1006 Bytes | W: | H:

textures/bitchange_mineninth.png

745 Bytes | W: | H:

textures/bitchange_mineninth.png
textures/bitchange_mineninth.png
textures/bitchange_mineninth.png
textures/bitchange_mineninth.png
  • 2-up
  • Swipe
  • Onion skin
textures/bitchange_moneychanger_side.png

320 Bytes | W: | H:

textures/bitchange_moneychanger_side.png

204 Bytes | W: | H:

textures/bitchange_moneychanger_side.png
textures/bitchange_moneychanger_side.png
textures/bitchange_moneychanger_side.png
textures/bitchange_moneychanger_side.png
  • 2-up
  • Swipe
  • Onion skin
textures/bitchange_moneychanger_top.png

1.26 KB | W: | H:

textures/bitchange_moneychanger_top.png

764 Bytes | W: | H:

textures/bitchange_moneychanger_top.png
textures/bitchange_moneychanger_top.png
textures/bitchange_moneychanger_top.png
textures/bitchange_moneychanger_top.png
  • 2-up
  • Swipe
  • Onion skin
textures/bitchange_shop_front.png

2.67 KB | W: | H:

textures/bitchange_shop_front.png

2.08 KB | W: | H:

textures/bitchange_shop_front.png
textures/bitchange_shop_front.png
textures/bitchange_shop_front.png
textures/bitchange_shop_front.png
  • 2-up
  • Swipe
  • Onion skin
textures/bitchange_shop_side.png

2.77 KB | W: | H:

textures/bitchange_shop_side.png

2.07 KB | W: | H:

textures/bitchange_shop_side.png
textures/bitchange_shop_side.png
textures/bitchange_shop_side.png
textures/bitchange_shop_side.png
  • 2-up
  • Swipe
  • Onion skin
textures/bitchange_shop_top.png

2.93 KB | W: | H:

textures/bitchange_shop_top.png

2.21 KB | W: | H:

textures/bitchange_shop_top.png
textures/bitchange_shop_top.png
textures/bitchange_shop_top.png
textures/bitchange_shop_top.png
  • 2-up
  • Swipe
  • Onion skin
textures/bitchange_toolrepair_top.png

928 Bytes | W: | H:

textures/bitchange_toolrepair_top.png

615 Bytes | W: | H:

textures/bitchange_toolrepair_top.png
textures/bitchange_toolrepair_top.png
textures/bitchange_toolrepair_top.png
textures/bitchange_toolrepair_top.png
  • 2-up
  • Swipe
  • Onion skin
textures/bitchange_warehouse_front.png

903 Bytes | W: | H:

textures/bitchange_warehouse_front.png

810 Bytes | W: | H:

textures/bitchange_warehouse_front.png
textures/bitchange_warehouse_front.png
textures/bitchange_warehouse_front.png
textures/bitchange_warehouse_front.png
  • 2-up
  • Swipe
  • Onion skin
textures/bitchange_warehouse_side.png

957 Bytes | W: | H:

textures/bitchange_warehouse_side.png

772 Bytes | W: | H:

textures/bitchange_warehouse_side.png
textures/bitchange_warehouse_side.png
textures/bitchange_warehouse_side.png
textures/bitchange_warehouse_side.png
  • 2-up
  • Swipe
  • Onion skin
textures/bitchange_warehouse_top.png

1.37 KB | W: | H:

textures/bitchange_warehouse_top.png

1.07 KB | W: | H:

textures/bitchange_warehouse_top.png
textures/bitchange_warehouse_top.png
textures/bitchange_warehouse_top.png
textures/bitchange_warehouse_top.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -2,20 +2,20 @@
--License: WTFPL
local function set_infotext(meta, mode)
if(mode == meta:get_int("state")) then
if mode == meta:get_int("state") then
return
end
local owner = meta:get_string("owner")
local text = "Tool Repair "
local text2 = "[Inactive]"
if(mode == 0) then
if mode == 0 then
text = text.."(constructing)"
elseif(mode == 1) then
elseif mode == 1 then
text2 = "Inactive"
elseif(mode == 2) then
elseif mode == 2 then
text2 = "Active"
end
if(mode ~= 0) then
if mode ~= 0 then
text = text.."["..text2.."] (owned by "..owner..")"
end
......@@ -59,19 +59,19 @@ minetest.register_node("bitchange:toolrepair", {
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
if player:get_player_name() ~= meta:get_string("owner") then
return 0
end
if(listname == "src") then
if listname == "src" then
if(stack:get_wear() > 0
and stack:get_wear() < 65535
and stack:get_name() ~= "technic:water_can"
and stack:get_name() ~= "technic:lava_can") then
return 1
end
elseif(listname == "fuel") then
if(stack:get_name() == "bitchange:mineninth") then
elseif listname == "fuel" then
if stack:get_name() == "bitchange:mineninth" then
return stack:get_count()
end
end
......@@ -79,7 +79,7 @@ minetest.register_node("bitchange:toolrepair", {
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if(bitchange_has_access(meta:get_string("owner"), player:get_player_name())) then
if bitchange.has_access(meta:get_string("owner"), player:get_player_name()) then
return stack:get_count()
end
return 0
......@@ -87,7 +87,7 @@ minetest.register_node("bitchange:toolrepair", {
can_dig = function(pos, player)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if(bitchange_has_access(meta:get_string("owner"), player:get_player_name())) then
if bitchange.has_access(meta:get_string("owner"), player:get_player_name()) then
return inv:is_empty("src") and inv:is_empty("fuel")
end
return 0
......@@ -95,11 +95,11 @@ minetest.register_node("bitchange:toolrepair", {
})
minetest.register_craft({
output = 'bitchange:toolrepair',
output = "bitchange:toolrepair",
recipe = {
{'default:steel_ingot', 'default:stick', 'default:steel_ingot'},
{'default:jungletree', 'default:mese_crystal', 'default:jungletree'},
{'default:jungletree', 'bitchange:minecoinblock', 'default:jungletree'}
{"default:steel_ingot", "default:stick", "default:steel_ingot"},
{"default:jungletree", "default:mese_crystal", "default:jungletree"},
{"default:jungletree", "bitchange:minecoinblock", "default:jungletree"}
}
})
......
......@@ -3,7 +3,7 @@
--License: WTFPL
function get_warehouse_tube_config(mode)
if(bitchange_warehouse_pipeworks) then
if(bitchange.warehouse_pipeworks) then
if(mode == 1) then
return {cracky=1, level=2, tubedevice=1, tubedevice_receiver=1}
else
......@@ -11,22 +11,22 @@ function get_warehouse_tube_config(mode)
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)
if inv:room_for_item("main", stack) then
return inv:add_item("main", stack)
else
return inv:add_item("main2",stack)
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
if inv:room_for_item("main", stack) then
return true
else
return inv:room_for_item("main2",stack)
return inv:room_for_item("main2", stack)
end
end,
input_inventory="main",