No ore generation by default, remove Coin base
Shop: limit title length to 80 characters Do not list ore nodes in creative inventory 10 MineNinths for a new player on start (previously 2) Replace bitchange privilege with protection_bypass Revert to classic 16px shop texture & run OptiPNG
@ -1,12 +1,11 @@
|
|||||||
Bitchange
|
BitChange
|
||||||
=========
|
=========
|
||||||
|
|
||||||
This mod adds the currency "MineCoin" to your Minetest world.
|
This mod adds the currency "MineCoin" to your Minetest world.
|
||||||
To change a setting, edit the file 'bitchange_config.txt' in your world directory.
|
To change a setting, edit the file 'bitchange_config.txt' in your world directory.
|
||||||
Copy and paste 'config.default.txt' if the file does not exist yet.
|
Copy and paste 'config.default.txt' if the file does not exist yet.
|
||||||
|
|
||||||
License: WTFPL (for code and textures)
|
License: CC0 (for everything)
|
||||||
Adds privilege: bitchange
|
|
||||||
|
|
||||||
Dependencies:
|
Dependencies:
|
||||||
default
|
default
|
||||||
|
2
bank.lua
@ -52,7 +52,7 @@ minetest.register_node("bitchange:bank", {
|
|||||||
"bitchange_bank_side.png", "bitchange_bank_side.png",
|
"bitchange_bank_side.png", "bitchange_bank_side.png",
|
||||||
"bitchange_bank_side.png", "bitchange_bank_front.png"},
|
"bitchange_bank_side.png", "bitchange_bank_front.png"},
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
groups = {cracky=1,level=1},
|
groups = {cracky=1, level=1, not_in_creative_inventory=1},
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
after_place_node = function(pos, placer)
|
after_place_node = function(pos, placer)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
-- General configuration - BitChange
|
-- General configuration - BitChange
|
||||||
-- Created by Krock
|
-- Do NOT change your settings in "config.default.txt"
|
||||||
|
|
||||||
bitchange.initial_give = 2
|
bitchange.initial_give = 10
|
||||||
-- Enable/Disable whole nodes
|
-- Enable/Disable whole nodes
|
||||||
bitchange.enable_exchangeshop = true
|
bitchange.enable_exchangeshop = true
|
||||||
bitchange.enable_moneychanger = true
|
bitchange.enable_moneychanger = true
|
||||||
@ -28,4 +28,4 @@ bitchange.warehouse_pipeworks = false
|
|||||||
|
|
||||||
-- Advanced generation settings
|
-- Advanced generation settings
|
||||||
-- Change in 'minecoins.lua', starting at line 101
|
-- Change in 'minecoins.lua', starting at line 101
|
||||||
bitchange.enable_generation = true
|
bitchange.enable_generation = false
|
12
init.lua
@ -1,12 +1,7 @@
|
|||||||
--Created by Krock for the BitChange mod
|
|
||||||
bitchange = {}
|
bitchange = {}
|
||||||
bitchange.mod_path = minetest.get_modpath("bitchange")
|
bitchange.mod_path = minetest.get_modpath("bitchange")
|
||||||
local world_path = minetest.get_worldpath()
|
local world_path = minetest.get_worldpath()
|
||||||
|
|
||||||
if rawget(_G, "freeminer") then
|
|
||||||
minetest = freeminer
|
|
||||||
end
|
|
||||||
|
|
||||||
dofile(bitchange.mod_path.."/config.default.txt")
|
dofile(bitchange.mod_path.."/config.default.txt")
|
||||||
-- Copied from moretrees mod
|
-- Copied from moretrees mod
|
||||||
if not io.open(world_path.."/bitchange_config.txt", "r") then
|
if not io.open(world_path.."/bitchange_config.txt", "r") then
|
||||||
@ -54,7 +49,7 @@ if bitchange.enable_bank then
|
|||||||
dofile(bitchange.mod_path.."/bank.lua")
|
dofile(bitchange.mod_path.."/bank.lua")
|
||||||
bitchange.bank.file_path = world_path.."/bitchange_bank_"..loaded_bank
|
bitchange.bank.file_path = world_path.."/bitchange_bank_"..loaded_bank
|
||||||
dofile(bitchange.mod_path.."/bank_"..loaded_bank..".lua")
|
dofile(bitchange.mod_path.."/bank_"..loaded_bank..".lua")
|
||||||
print("[BitChange] Bank loaded: "..loaded_bank)
|
minetest.log("action", "[BitChange] Bank loaded: "..loaded_bank)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -66,13 +61,12 @@ if not minetest.setting_getbool("creative_mode") and bitchange.initial_give > 0
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Privs
|
-- 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)
|
||||||
if player_name == owner or owner == "" then
|
if player_name == owner or owner == "" then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
local privs = minetest.get_player_privs(player_name)
|
local privs = minetest.get_player_privs(player_name)
|
||||||
return privs.server or privs.bitchange
|
return privs.server or privs.protection_bypass
|
||||||
end
|
end
|
||||||
|
|
||||||
print("[BitChange] Loaded.")
|
minetest.log("action", "[BitChange] Loaded.")
|
||||||
|
@ -1,13 +1,9 @@
|
|||||||
--bitcoins by MilesDyson@DistroGeeks.com
|
|
||||||
--Modified by Krock
|
|
||||||
--License: WTFPL
|
|
||||||
|
|
||||||
-- Node definitions
|
-- Node definitions
|
||||||
minetest.register_node("bitchange:minecoin_in_ground", {
|
minetest.register_node("bitchange:minecoin_in_ground", {
|
||||||
description = "MineCoin Ore",
|
description = "you hacker!",
|
||||||
tiles = { "default_stone.png^bitchange_minecoin_in_ground.png" },
|
tiles = { "default_stone.png^bitchange_minecoin_in_ground.png" },
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {cracky=2},
|
groups = {cracky=2, not_in_creative_inventory=1},
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
drop = {
|
drop = {
|
||||||
max_items = 2,
|
max_items = 2,
|
||||||
@ -19,17 +15,16 @@ minetest.register_node("bitchange:minecoin_in_ground", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("bitchange:mineninth_in_ground", {
|
minetest.register_node("bitchange:mineninth_in_ground", {
|
||||||
description = "MineNinth Ore",
|
description = "you hacker!",
|
||||||
tiles = { "default_stone.png^bitchange_mineninth_in_ground.png" },
|
tiles = { "default_stone.png^bitchange_mineninth_in_ground.png" },
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {cracky=3},
|
groups = {cracky=3, not_in_creative_inventory=1},
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
drop = {
|
drop = {
|
||||||
max_items = 3,
|
max_items = 3,
|
||||||
items = {
|
items = {
|
||||||
{items = {"bitchange:coinbase"}, rarity = 5 },
|
{items = {"bitchange:mineninth 4"}, rarity = 3 },
|
||||||
{items = {"bitchange:coinbase 2"}, rarity = 3 },
|
{items = {"bitchange:mineninth 6"} }
|
||||||
{items = {"bitchange:coinbase 6"} }
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -37,7 +32,6 @@ minetest.register_node("bitchange:mineninth_in_ground", {
|
|||||||
minetest.register_node("bitchange:minecoinblock", {
|
minetest.register_node("bitchange:minecoinblock", {
|
||||||
description = "MineCoin Block",
|
description = "MineCoin Block",
|
||||||
tiles = { "bitchange_minecoinblock.png" },
|
tiles = { "bitchange_minecoinblock.png" },
|
||||||
is_ground_content = true,
|
|
||||||
groups = {cracky=2},
|
groups = {cracky=2},
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
stack_max = 30000,
|
stack_max = 30000,
|
||||||
@ -55,10 +49,7 @@ minetest.register_craftitem("bitchange:mineninth", {
|
|||||||
stack_max = 30000,
|
stack_max = 30000,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("bitchange:coinbase", {
|
minetest.register_alias("bitchange:coinbase", "bitchange:mineninth")
|
||||||
description = "Coin base",
|
|
||||||
inventory_image = "bitchange_coinbase.png",
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Crafting
|
-- Crafting
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
@ -94,12 +85,6 @@ minetest.register_craft({
|
|||||||
})
|
})
|
||||||
|
|
||||||
-- Cooking
|
-- Cooking
|
||||||
minetest.register_craft({
|
|
||||||
type = "cooking",
|
|
||||||
recipe = "bitchange:coinbase",
|
|
||||||
output = "bitchange:mineninth",
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "cooking",
|
type = "cooking",
|
||||||
recipe = "default:goldblock",
|
recipe = "default:goldblock",
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
--Created by Krock
|
-- Conversion of other ores to money
|
||||||
--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({
|
minetest.register_craft({
|
||||||
output = "bitchange:coinbase 18",
|
output = "bitchange:mineninth 18",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"moreores:tin_block", "default:pick_diamond"},
|
{"moreores:tin_block", "default:pick_diamond"},
|
||||||
{"moreores:tin_block", ""}
|
{"moreores:tin_block", ""}
|
||||||
@ -14,7 +13,7 @@ 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({
|
minetest.register_craft({
|
||||||
output = "bitchange:coinbase 8",
|
output = "bitchange:mineninth 8",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"technic:zinc_block", "default:pick_diamond"},
|
{"technic:zinc_block", "default:pick_diamond"},
|
||||||
{"technic:zinc_block", ""}
|
{"technic:zinc_block", ""}
|
||||||
@ -25,7 +24,7 @@ end
|
|||||||
|
|
||||||
if bitchange.use_quartz and minetest.get_modpath("quartz") then
|
if bitchange.use_quartz and minetest.get_modpath("quartz") then
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "bitchange:coinbase",
|
output = "bitchange:mineninth",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"quartz:quartz_crystal", "default:pick_diamond"},
|
{"quartz:quartz_crystal", "default:pick_diamond"},
|
||||||
{"quartz:quartz_crystal", "quartz:quartz_crystal"},
|
{"quartz:quartz_crystal", "quartz:quartz_crystal"},
|
||||||
|
9
shop.lua
@ -16,8 +16,11 @@ if not bitchange then
|
|||||||
bitchange.exchangeshop_pipeworks = true
|
bitchange.exchangeshop_pipeworks = true
|
||||||
|
|
||||||
function bitchange.has_access(owner, player_name)
|
function bitchange.has_access(owner, player_name)
|
||||||
return (player_name == owner or owner == ""
|
if player_name == owner or owner == "" then
|
||||||
or minetest.get_player_privs(player_name).server)
|
return true
|
||||||
|
end
|
||||||
|
local privs = minetest.get_player_privs(player_name)
|
||||||
|
return privs.server or privs.protection_bypass
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -197,6 +200,8 @@ minetest.register_on_player_receive_fields(function(sender, formname, fields)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if fields.title then
|
if fields.title then
|
||||||
|
-- Limit title length
|
||||||
|
fields.title = fields.title:sub(1, 80)
|
||||||
if title ~= fields.title then
|
if title ~= fields.title then
|
||||||
if fields.title ~= "" then
|
if fields.title ~= "" then
|
||||||
meta:set_string("infotext", "'" .. fields.title
|
meta:set_string("infotext", "'" .. fields.title
|
||||||
|
Before Width: | Height: | Size: 482 B |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 738 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 672 B |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 652 B |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |