commit 5f353bc2b3483db80cc218da7997f30f1dacb6a2 Author: Eric Meehan Date: Sat Apr 11 13:44:26 2026 -0400 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1377554 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.swp diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d1195b2 --- /dev/null +++ b/LICENSE @@ -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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..8fa58d2 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# Expanded City Commoditymarkets + +Adds additional markets to [City CommodityMarkets](https://content.luanti.org/packages/x5dragonfire/city_commoditymarket/). + + diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..e02dc25 --- /dev/null +++ b/depends.txt @@ -0,0 +1,2 @@ +commoditymarket +currency diff --git a/description.txt b/description.txt new file mode 100644 index 0000000..730a2e3 --- /dev/null +++ b/description.txt @@ -0,0 +1 @@ +Adds extra CommodityMarkets for city's towns etc.. diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..d895774 --- /dev/null +++ b/init.lua @@ -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 +}) diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..a7618e7 --- /dev/null +++ b/mod.conf @@ -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 diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..de5ad53 Binary files /dev/null and b/screenshot.png differ diff --git a/textures/central_market2_side.png b/textures/central_market2_side.png new file mode 100644 index 0000000..44185c9 Binary files /dev/null and b/textures/central_market2_side.png differ diff --git a/textures/central_market2_top.png b/textures/central_market2_top.png new file mode 100644 index 0000000..5960af9 Binary files /dev/null and b/textures/central_market2_top.png differ diff --git a/textures/central_market_front.png b/textures/central_market_front.png new file mode 100644 index 0000000..5438be8 Binary files /dev/null and b/textures/central_market_front.png differ diff --git a/textures/central_market_front1.png b/textures/central_market_front1.png new file mode 100644 index 0000000..144f3c2 Binary files /dev/null and b/textures/central_market_front1.png differ diff --git a/textures/central_market_front10.png b/textures/central_market_front10.png new file mode 100644 index 0000000..7d86b06 Binary files /dev/null and b/textures/central_market_front10.png differ diff --git a/textures/central_market_front11.png b/textures/central_market_front11.png new file mode 100644 index 0000000..7a7a037 Binary files /dev/null and b/textures/central_market_front11.png differ diff --git a/textures/central_market_front2.png b/textures/central_market_front2.png new file mode 100644 index 0000000..a88435e Binary files /dev/null and b/textures/central_market_front2.png differ diff --git a/textures/central_market_front3.png b/textures/central_market_front3.png new file mode 100644 index 0000000..96d143f Binary files /dev/null and b/textures/central_market_front3.png differ diff --git a/textures/central_market_front4.png b/textures/central_market_front4.png new file mode 100644 index 0000000..aa8772b Binary files /dev/null and b/textures/central_market_front4.png differ diff --git a/textures/central_market_front5.png b/textures/central_market_front5.png new file mode 100644 index 0000000..d6b38f7 Binary files /dev/null and b/textures/central_market_front5.png differ diff --git a/textures/central_market_front6.png b/textures/central_market_front6.png new file mode 100644 index 0000000..64c8272 Binary files /dev/null and b/textures/central_market_front6.png differ diff --git a/textures/central_market_front7.png b/textures/central_market_front7.png new file mode 100644 index 0000000..c7557f2 Binary files /dev/null and b/textures/central_market_front7.png differ diff --git a/textures/central_market_front8.png b/textures/central_market_front8.png new file mode 100644 index 0000000..ff41e8b Binary files /dev/null and b/textures/central_market_front8.png differ diff --git a/textures/central_market_front9.png b/textures/central_market_front9.png new file mode 100644 index 0000000..260efc3 Binary files /dev/null and b/textures/central_market_front9.png differ