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
This commit is contained in:
SmallJoker 2017-11-25 11:38:52 +01:00
parent 0fbda6a40f
commit 3f029c82d6
13 changed files with 29 additions and 46 deletions

View File

@ -1,12 +1,11 @@
Bitchange
BitChange
=========
This mod adds the currency "MineCoin" to your Minetest world.
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.
License: WTFPL (for code and textures)
Adds privilege: bitchange
License: CC0 (for everything)
Dependencies:
default

View File

@ -52,7 +52,7 @@ minetest.register_node("bitchange:bank", {
"bitchange_bank_side.png", "bitchange_bank_side.png",
"bitchange_bank_side.png", "bitchange_bank_front.png"},
paramtype2 = "facedir",
groups = {cracky=1,level=1},
groups = {cracky=1, level=1, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
after_place_node = function(pos, placer)
local meta = minetest.get_meta(pos)
@ -99,7 +99,7 @@ minetest.register_node("bitchange:bank", {
end
return 0
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 bitchange.has_access(meta:get_string("owner"), player:get_player_name()) then
return stack:get_count()

View File

@ -1,7 +1,7 @@
-- 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
bitchange.enable_exchangeshop = true
bitchange.enable_moneychanger = true
@ -28,4 +28,4 @@ bitchange.warehouse_pipeworks = false
-- Advanced generation settings
-- Change in 'minecoins.lua', starting at line 101
bitchange.enable_generation = true
bitchange.enable_generation = false

View File

@ -1,12 +1,7 @@
--Created by Krock for the BitChange mod
bitchange = {}
bitchange.mod_path = minetest.get_modpath("bitchange")
local world_path = minetest.get_worldpath()
if rawget(_G, "freeminer") then
minetest = freeminer
end
dofile(bitchange.mod_path.."/config.default.txt")
-- Copied from moretrees mod
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")
bitchange.bank.file_path = world_path.."/bitchange_bank_"..loaded_bank
dofile(bitchange.mod_path.."/bank_"..loaded_bank..".lua")
print("[BitChange] Bank loaded: "..loaded_bank)
minetest.log("action", "[BitChange] Bank loaded: "..loaded_bank)
end
end
@ -66,13 +61,12 @@ if not minetest.setting_getbool("creative_mode") and bitchange.initial_give > 0
end
-- Privs
minetest.register_privilege("bitchange", "Can access to owned nodes of the bitchange mod")
function bitchange.has_access(owner, player_name)
if player_name == owner or owner == "" then
return true
end
local privs = minetest.get_player_privs(player_name)
return privs.server or privs.bitchange
return privs.server or privs.protection_bypass
end
print("[BitChange] Loaded.")
minetest.log("action", "[BitChange] Loaded.")

View File

@ -1,13 +1,9 @@
--bitcoins by MilesDyson@DistroGeeks.com
--Modified by Krock
--License: WTFPL
-- Node definitions
minetest.register_node("bitchange:minecoin_in_ground", {
description = "MineCoin Ore",
description = "you hacker!",
tiles = { "default_stone.png^bitchange_minecoin_in_ground.png" },
is_ground_content = true,
groups = {cracky=2},
groups = {cracky=2, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
drop = {
max_items = 2,
@ -19,17 +15,16 @@ minetest.register_node("bitchange:minecoin_in_ground", {
})
minetest.register_node("bitchange:mineninth_in_ground", {
description = "MineNinth Ore",
description = "you hacker!",
tiles = { "default_stone.png^bitchange_mineninth_in_ground.png" },
is_ground_content = true,
groups = {cracky=3},
groups = {cracky=3, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
drop = {
max_items = 3,
items = {
{items = {"bitchange:coinbase"}, rarity = 5 },
{items = {"bitchange:coinbase 2"}, rarity = 3 },
{items = {"bitchange:coinbase 6"} }
{items = {"bitchange:mineninth 4"}, rarity = 3 },
{items = {"bitchange:mineninth 6"} }
}
},
})
@ -37,7 +32,6 @@ minetest.register_node("bitchange:mineninth_in_ground", {
minetest.register_node("bitchange:minecoinblock", {
description = "MineCoin Block",
tiles = { "bitchange_minecoinblock.png" },
is_ground_content = true,
groups = {cracky=2},
sounds = default.node_sound_stone_defaults(),
stack_max = 30000,
@ -55,10 +49,7 @@ minetest.register_craftitem("bitchange:mineninth", {
stack_max = 30000,
})
minetest.register_craftitem("bitchange:coinbase", {
description = "Coin base",
inventory_image = "bitchange_coinbase.png",
})
minetest.register_alias("bitchange:coinbase", "bitchange:mineninth")
-- Crafting
minetest.register_craft({
@ -94,12 +85,6 @@ minetest.register_craft({
})
-- Cooking
minetest.register_craft({
type = "cooking",
recipe = "bitchange:coinbase",
output = "bitchange:mineninth",
})
minetest.register_craft({
type = "cooking",
recipe = "default:goldblock",

1
mod.conf Normal file
View File

@ -0,0 +1 @@
name = bitchange

View File

@ -1,9 +1,8 @@
--Created by Krock
--License: WTFPL
-- Conversion of other ores to money
if bitchange.use_moreores_tin and minetest.get_modpath("moreores") then
minetest.register_craft({
output = "bitchange:coinbase 18",
output = "bitchange:mineninth 18",
recipe = {
{"moreores:tin_block", "default:pick_diamond"},
{"moreores:tin_block", ""}
@ -14,7 +13,7 @@ end
if bitchange.use_technic_zinc and minetest.get_modpath("technic_worldgen") then
minetest.register_craft({
output = "bitchange:coinbase 8",
output = "bitchange:mineninth 8",
recipe = {
{"technic:zinc_block", "default:pick_diamond"},
{"technic:zinc_block", ""}
@ -25,7 +24,7 @@ end
if bitchange.use_quartz and minetest.get_modpath("quartz") then
minetest.register_craft({
output = "bitchange:coinbase",
output = "bitchange:mineninth",
recipe = {
{"quartz:quartz_crystal", "default:pick_diamond"},
{"quartz:quartz_crystal", "quartz:quartz_crystal"},

View File

@ -16,8 +16,11 @@ if not bitchange then
bitchange.exchangeshop_pipeworks = true
function bitchange.has_access(owner, player_name)
return (player_name == owner or owner == ""
or minetest.get_player_privs(player_name).server)
if player_name == owner or owner == "" then
return true
end
local privs = minetest.get_player_privs(player_name)
return privs.server or privs.protection_bypass
end
end
@ -197,6 +200,8 @@ minetest.register_on_player_receive_fields(function(sender, formname, fields)
end
if fields.title then
-- Limit title length
fields.title = fields.title:sub(1, 80)
if title ~= fields.title then
if fields.title ~= "" then
meta:set_string("infotext", "'" .. fields.title

Binary file not shown.

Before

Width:  |  Height:  |  Size: 482 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 738 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 672 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB