Initial commit

This commit is contained in:
2026-04-11 13:44:26 -04:00
commit 5f353bc2b3
22 changed files with 354 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
*.swp

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 X5DragonFire
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

5
README.md Normal file
View File

@@ -0,0 +1,5 @@
# Expanded City Commoditymarkets
Adds additional markets to [City CommodityMarkets](https://content.luanti.org/packages/x5dragonfire/city_commoditymarket/).

2
depends.txt Normal file
View File

@@ -0,0 +1,2 @@
commoditymarket
currency

1
description.txt Normal file
View File

@@ -0,0 +1 @@
Adds extra CommodityMarkets for city's towns etc..

318
init.lua Normal file
View File

@@ -0,0 +1,318 @@
expanded_city_commoditymarket = {}
local modpath = minetest.get_modpath(minetest.get_current_modname())
local default_modpath = minetest.get_modpath("default")
local currency_modpath = minetest.get_modpath("currency")
local default_items = {"default:tin_lump","default:tin_ingot","default:tin_block","default:copper_lump","default:copper_ingot","default:copper_block","default:iron_lump","default:bronze_ingot","default:bronze_block","default:steel_ingot","default:steel_block","default:gold_lump","default:gold_ingot","default:gold_block","default:diamond","default:diamond_block","default:mese_crystal_fragment","default:mese_crystal","default:mese_block","default:coal_lump","default:coal_block",}
-- local default_items = {"default:axe_bronze","default:axe_diamond","default:axe_mese","default:axe_steel","default:axe_steel","default:axe_stone","default:axe_wood","default:pick_bronze","default:pick_diamond","default:pick_mese","default:pick_steel","default:pick_stone","default:pick_wood","default:shovel_bronze","default:shovel_diamond","default:shovel_mese","default:shovel_steel","default:shovel_stone","default:shovel_wood","default:sword_bronze","default:sword_diamond","default:sword_mese","default:sword_steel","default:sword_stone","default:sword_wood", "default:blueberries", "default:book", "default:bronze_ingot", "default:clay_brick", "default:clay_lump", "default:coal_lump", "default:copper_ingot", "default:copper_lump", "default:diamond", "default:flint", "default:gold_ingot", "default:gold_lump", "default:iron_lump", "default:mese_crystal", "default:mese_crystal_fragment", "default:obsidian_shard", "default:paper", "default:steel_ingot", "default:stick", "default:tin_ingot", "default:tin_lump", "default:acacia_tree", "default:acacia_wood", "default:apple", "default:aspen_tree", "default:aspen_wood", "default:blueberry_bush_sapling", "default:bookshelf", "default:brick", "default:bronzeblock", "default:bush_sapling", "default:cactus", "default:clay", "default:coalblock", "default:cobble", "default:copperblock", "default:desert_cobble", "default:desert_sand", "default:desert_sandstone", "default:desert_sandstone_block", "default:desert_sandstone_brick", "default:desert_stone", "default:desert_stone_block", "default:desert_stonebrick", "default:diamondblock", "default:dirt", "default:glass", "default:goldblock", "default:gravel", "default:ice", "default:junglegrass", "default:junglesapling", "default:jungletree", "default:junglewood", "default:ladder_steel", "default:ladder_wood", "default:large_cactus_seedling", "default:mese", "default:mese_post_light", "default:meselamp", "default:mossycobble", "default:obsidian", "default:obsidian_block", "default:obsidian_glass", "default:obsidianbrick", "default:papyrus", "default:pine_sapling", "default:pine_tree", "default:pine_wood", "default:sand", "default:sandstone", "default:sandstone_block", "default:sandstonebrick", "default:sapling", "default:silver_sand", "default:silver_sandstone", "default:silver_sandstone_block", "default:silver_sandstone_brick", "default:snow", "default:snowblock", "default:steelblock", "default:stone", "default:stone_block", "default:stonebrick", "default:tinblock", "default:tree", "default:wood",}
if currency_modpath then
expanded_city_commoditymarket_currency = {
["currency:minegeld_cent_5"] = 0.05,
["currency:minegeld_cent_10"] = 0.10,
["currency:minegeld_cent_25"] = 0.25,
["currency:minegeld"] = 1,
["currency:minegeld_5"] = 5,
["currency:minegeld_10"] = 10,
["currency:minegeld_50"] = 50,
["currency:minegeld_100"] = 100
}
end
-- defines a market and the varables
local market1_def = {
description = "Central Market Red", -- A short name for this market, appears as the text of the "info" tab of the market's UI
long_description = "A Central Market for trade", -- A longer description with flavor text and other information to present to the user, shown in the info tab. Optional.
currency = expanded_city_commoditymarket_currency,
currency_symbol = "$", -- "\u{263C}" Alchemical symbol for gold
inventory_limit = 1600, -- max blocks one player can store in the market inventory
sell_limit = 3200, -- max blocks one player can sell at one time
initial_items = default_items,
}
commoditymarket.register_market("central_market1", market1_def)
minetest.register_node("expanded_city_commoditymarket:central_market_1", {
description = market1_def.description,
_doc_items_longdesc = market1_def.long_description,
tiles = {"central_market2_top.png","central_market2_top.png",
"central_market2_side.png","central_market2_side.png",
"central_market2_side.png","central_market2_side.png^central_market_front.png^central_market_front1.png",},
paramtype2 = "facedir",
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 1,},
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
commoditymarket.show_market("central_market1", clicker:get_player_name())
end
})
-- defines a market and the varables
local market2_def = {
description = "Central Market Blue", -- A short name for this market, appears as the text of the "info" tab of the market's UI
long_description = "A Central Market for trade", -- A longer description with flavor text and other information to present to the user, shown in the info tab. Optional.
currency = expanded_city_commoditymarket_currency,
currency_symbol = "$", -- "\u{263C}" Alchemical symbol for gold
inventory_limit = 1600, -- max blocks one player can store in the market inventory
sell_limit = 3200, -- max blocks one player can sell at one time
initial_items = default_items,
}
commoditymarket.register_market("central_market2", market2_def)
minetest.register_node("expanded_city_commoditymarket:central_market_2", {
description = market2_def.description,
_doc_items_longdesc = market2_def.long_description,
tiles = {"central_market2_top.png","central_market2_top.png",
"central_market2_side.png","central_market2_side.png",
"central_market2_side.png","central_market2_side.png^central_market_front.png^central_market_front2.png",},
paramtype2 = "facedir",
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 1,},
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
commoditymarket.show_market("central_market2", clicker:get_player_name())
end
})
-- defines a market and the varables
local market3_def = {
description = "Central Market Green", -- A short name for this market, appears as the text of the "info" tab of the market's UI
long_description = "A Central Market for trade", -- A longer description with flavor text and other information to present to the user, shown in the info tab. Optional.
currency = expanded_city_commoditymarket_currency,
currency_symbol = "$", -- "\u{263C}" Alchemical symbol for gold
inventory_limit = 1600, -- max blocks one player can store in the market inventory
sell_limit = 3200, -- max blocks one player can sell at one time
initial_items = default_items,
}
commoditymarket.register_market("central_market3", market3_def)
minetest.register_node("expanded_city_commoditymarket:central_market_3", {
description = market3_def.description,
_doc_items_longdesc = market3_def.long_description,
tiles = {"central_market2_top.png","central_market2_top.png",
"central_market2_side.png","central_market2_side.png",
"central_market2_side.png","central_market2_side.png^central_market_front.png^central_market_front3.png",},
paramtype2 = "facedir",
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 1,},
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
commoditymarket.show_market("central_market3", clicker:get_player_name())
end
})
-- defines a market and the varables
local market4_def = {
description = "Central Market Orange", -- A short name for this market, appears as the text of the "info" tab of the market's UI
long_description = "A Central Market for trade", -- A longer description with flavor text and other information to present to the user, shown in the info tab. Optional.
currency = expanded_city_commoditymarket_currency,
currency_symbol = "$", -- "\u{263C}" Alchemical symbol for gold
inventory_limit = 1600, -- max blocks one player can store in the market inventory
sell_limit = 3200, -- max blocks one player can sell at one time
initial_items = default_items,
}
commoditymarket.register_market("central_market4", market4_def)
minetest.register_node("expanded_city_commoditymarket:central_market_4", {
description = market4_def.description,
_doc_items_longdesc = market4_def.long_description,
tiles = {"central_market2_top.png","central_market2_top.png",
"central_market2_side.png","central_market2_side.png",
"central_market2_side.png","central_market2_side.png^central_market_front.png^central_market_front4.png",},
paramtype2 = "facedir",
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 1,},
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
commoditymarket.show_market("central_market4", clicker:get_player_name())
end
})
-- defines a market and the varables
local market5_def = {
description = "Central Market Black", -- A short name for this market, appears as the text of the "info" tab of the market's UI
long_description = "A Central Market for trade", -- A longer description with flavor text and other information to present to the user, shown in the info tab. Optional.
currency = expanded_city_commoditymarket_currency,
currency_symbol = "$", -- "\u{263C}" Alchemical symbol for gold
inventory_limit = 1600, -- max blocks one player can store in the market inventory
sell_limit = 3200, -- max blocks one player can sell at one time
initial_items = default_items,
}
commoditymarket.register_market("central_market5", market5_def)
minetest.register_node("expanded_city_commoditymarket:central_market_5", {
description = market5_def.description,
_doc_items_longdesc = market5_def.long_description,
tiles = {"central_market2_top.png","central_market2_top.png",
"central_market2_side.png","central_market2_side.png",
"central_market2_side.png","central_market2_side.png^central_market_front.png^central_market_front5.png",},
paramtype2 = "facedir",
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 1,},
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
commoditymarket.show_market("central_market5", clicker:get_player_name())
end
})
-- defines a market and the varables
local market6_def = {
description = "Central Market Brown", -- A short name for this market, appears as the text of the "info" tab of the market's UI
long_description = "A Central Market for trade", -- A longer description with flavor text and other information to present to the user, shown in the info tab. Optional.
currency = expanded_city_commoditymarket_currency,
currency_symbol = "$", -- "\u{263C}" Alchemical symbol for gold
inventory_limit = 1600, -- max blocks one player can store in the market inventory
sell_limit = 3200, -- max blocks one player can sell at one time
initial_items = default_items,
}
commoditymarket.register_market("central_market6", market6_def)
minetest.register_node("expanded_city_commoditymarket:central_market_6", {
description = market6_def.description,
_doc_items_longdesc = market6_def.long_description,
tiles = {"central_market2_top.png","central_market2_top.png",
"central_market2_side.png","central_market2_side.png",
"central_market2_side.png","central_market2_side.png^central_market_front.png^central_market_front6.png",},
paramtype2 = "facedir",
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 1,},
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
commoditymarket.show_market("central_market6", clicker:get_player_name())
end
})
-- defines a market and the varables
local market7_def = {
description = "Central Market Cyan", -- A short name for this market, appears as the text of the "info" tab of the market's UI
long_description = "A Central Market for trade", -- A longer description with flavor text and other information to present to the user, shown in the info tab. Optional.
currency = expanded_city_commoditymarket_currency,
currency_symbol = "$", -- "\u{263C}" Alchemical symbol for gold
inventory_limit = 1600, -- max blocks one player can store in the market inventory
sell_limit = 3200, -- max blocks one player can sell at one time
initial_items = default_items,
}
commoditymarket.register_market("central_market7", market7_def)
minetest.register_node("expanded_city_commoditymarket:central_market_7", {
description = market7_def.description,
_doc_items_longdesc = market7_def.long_description,
tiles = {"central_market2_top.png","central_market2_top.png",
"central_market2_side.png","central_market2_side.png",
"central_market2_side.png","central_market2_side.png^central_market_front.png^central_market_front7.png",},
paramtype2 = "facedir",
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 1,},
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
commoditymarket.show_market("central_market7", clicker:get_player_name())
end
})
-- defines a market and the varables
local market8_def = {
description = "Central Market Pink", -- A short name for this market, appears as the text of the "info" tab of the market's UI
long_description = "A Central Market for trade", -- A longer description with flavor text and other information to present to the user, shown in the info tab. Optional.
currency = expanded_city_commoditymarket_currency,
currency_symbol = "$", -- "\u{263C}" Alchemical symbol for gold
inventory_limit = 1600, -- max blocks one player can store in the market inventory
sell_limit = 3200, -- max blocks one player can sell at one time
initial_items = default_items,
}
commoditymarket.register_market("central_market8", market8_def)
minetest.register_node("expanded_city_commoditymarket:central_market_8", {
description = market8_def.description,
_doc_items_longdesc = market8_def.long_description,
tiles = {"central_market2_top.png","central_market2_top.png",
"central_market2_side.png","central_market2_side.png",
"central_market2_side.png","central_market2_side.png^central_market_front.png^central_market_front8.png",},
paramtype2 = "facedir",
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 1,},
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
commoditymarket.show_market("central_market8", clicker:get_player_name())
end
})
-- defines a market and the varables
local market9_def = {
description = "Central Market Purple", -- A short name for this market, appears as the text of the "info" tab of the market's UI
long_description = "A Central Market for trade", -- A longer description with flavor text and other information to present to the user, shown in the info tab. Optional.
currency = expanded_city_commoditymarket_currency,
currency_symbol = "$", -- "\u{263C}" Alchemical symbol for gold
inventory_limit = 1600, -- max blocks one player can store in the market inventory
sell_limit = 3200, -- max blocks one player can sell at one time
initial_items = default_items,
}
commoditymarket.register_market("central_market9", market9_def)
minetest.register_node("expanded_city_commoditymarket:central_market_9", {
description = market9_def.description,
_doc_items_longdesc = market9_def.long_description,
tiles = {"central_market2_top.png","central_market2_top.png",
"central_market2_side.png","central_market2_side.png",
"central_market2_side.png","central_market2_side.png^central_market_front.png^central_market_front9.png",},
paramtype2 = "facedir",
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 1,},
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
commoditymarket.show_market("central_market9", clicker:get_player_name())
end
})
-- defines a market and the varables
local market10_def = {
description = "Central Market White", -- A short name for this market, appears as the text of the "info" tab of the market's UI
long_description = "A Central Market for trade", -- A longer description with flavor text and other information to present to the user, shown in the info tab. Optional.
currency = expanded_city_commoditymarket_currency,
currency_symbol = "$", -- "\u{263C}" Alchemical symbol for gold
inventory_limit = 1600, -- max blocks one player can store in the market inventory
sell_limit = 3200, -- max blocks one player can sell at one time
initial_items = default_items,
}
commoditymarket.register_market("central_market10", market10_def)
minetest.register_node("expanded_city_commoditymarket:central_market_10", {
description = market10_def.description,
_doc_items_longdesc = market10_def.long_description,
tiles = {"central_market2_top.png","central_market2_top.png",
"central_market2_side.png","central_market2_side.png",
"central_market2_side.png","central_market2_side.png^central_market_front.png^central_market_front10.png",},
paramtype2 = "facedir",
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 1,},
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
commoditymarket.show_market("central_market10", clicker:get_player_name())
end
})
-- defines a market and the varables
local market11_def = {
description = "Central Market Yellow", -- A short name for this market, appears as the text of the "info" tab of the market's UI
long_description = "A Central Market for trade", -- A longer description with flavor text and other information to present to the user, shown in the info tab. Optional.
currency = expanded_city_commoditymarket_currency,
currency_symbol = "$", -- "\u{263C}" Alchemical symbol for gold
inventory_limit = 1600, -- max blocks one player can store in the market inventory
sell_limit = 3200, -- max blocks one player can sell at one time
initial_items = default_items,
}
commoditymarket.register_market("central_market11", market11_def)
minetest.register_node("expanded_city_commoditymarket:central_market_11", {
description = market11_def.description,
_doc_items_longdesc = market11_def.long_description,
tiles = {"central_market2_top.png","central_market2_top.png",
"central_market2_side.png","central_market2_side.png",
"central_market2_side.png","central_market2_side.png^central_market_front.png^central_market_front11.png",},
paramtype2 = "facedir",
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 1,},
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
commoditymarket.show_market("central_market11", clicker:get_player_name())
end
})

6
mod.conf Normal file
View File

@@ -0,0 +1,6 @@
name = expanded_city_commoditymarket
author = ericomeehan
title = Expanded City CommodityMarket
description = Adds additional CommodityMarkets for city's towns etc..
depends = commoditymarket, currency

BIN
screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B