A Minetest+MineClone mod to manage the economy and shops
Go to file
2024-04-01 19:44:56 +02:00
locale locales update 2024-02-12 11:20:02 +01:00
sounds autor del archivo de sonido 2022-03-11 18:54:43 +01:00
textures remove shop front 2024-04-01 19:44:56 +02:00
.luacheckrc on_blast return nil 2024-03-08 16:40:24 +01:00
atm.lua Patched emerald cheat glitch by adding wait time for players to get start balance 2024-01-10 14:40:50 +00:00
bank.lua new bank recipe 2023-08-27 08:39:49 +02:00
commands.lua Made it so the transfer_emeralds function now takes player names as input as well as objects, and pay function now works when players are offline. 2024-01-15 13:20:15 +00:00
fancyshop.lua remove shop front 2024-04-01 19:44:56 +02:00
forms.lua atm funcs reworked 2023-08-30 02:58:29 +02:00
functions.lua Made it so the transfer_emeralds function now takes player names as input as well as objects, and pay function now works when players are offline. 2024-01-15 13:20:15 +00:00
hud.lua emeralds in HUD 2024-03-28 18:37:41 +01:00
income.lua Patched emerald cheat glitch by adding wait time for players to get start balance 2024-01-10 14:40:50 +00:00
init.lua emeralds in HUD 2024-03-28 18:37:41 +01:00
LICENSE license file renamed 2023-09-13 00:40:38 +02:00
mod.conf supported_games updated 2023-12-16 15:40:22 +01:00
README.md readme update 2024-03-28 21:30:25 +01:00
receive_fields_wt.lua mail when money transfer again 2023-08-30 03:18:38 +02:00
receive_fields.lua atm funcs reworked 2023-08-30 02:58:29 +02:00
screenshot.png update readme and screenshot 2023-08-18 06:31:05 +02:00
settingtypes.txt emeralds in HUD 2024-03-28 18:37:41 +01:00
shop.lua fix comma 2023-11-19 11:38:07 +01:00

Emerald Bank and Shops (MineClonia/MineClone2)

ContentDB

Screenshot

Code under AGPLv3-or-later License

EmeraldBank Mod is Libre/Free Software, copy and share.

This is not open source!

Bank

Keep your Emeralds in a bank!

Why Emeralds? In MineClonia/MineClone2 the emerald is money to trade with villagers!

Multiplayer support!

Add a crafteable Emerald bank node.

Works like gpcf's ATMs but with Emeralds!

Rightclick on bank open the bank interface, where you can deposit or withdraw your Emeralds.

You can transfer money to other players in Bank interface.

Shops (Like fancy_vend mod)

The new shops are based in fancy_vend mod shops

Learn more about shops here

There are many vendor mods for Minetest, but most have too few options, lack support for automation mods, or are too tedious to set up and maintain. Fancy vendors are entirely self-contained nodes which provide light, trade, display and store items. Fancy vendors are pipeworks, digilines and mcl_awards compatible, enabling a variety of automation-based features.

Basic configuration

Each fancy vendor needs 2 nodes of room. If the area you wish to place the vendor doesn't have enough space, due to either a node or a protected area, the node will not be placed. If the vendor has sufficient room, it will place a vendor node in addition to a display node on top. The display node's only purpose is aesthetics, to "contain" the rotating display object.

Configuring a vendor is as simple as picking up and placing the input and output items into their respective slots as if they were regular inventories (items in these inventories are "ghosts", so don't actually take anything from the player's inventory) and setting the quantities for each item, as shown below:

Setting up a vendor

Stocking a vendor is as simple as placing the output item into the vendor's inventory (perhaps using one of the handy inventory movement buttons) as demonstrated below:

Stocking a vendor

After stocking a vendor, you may wish to press the "sort" button, which will combine unfilled stacks and sort the stacks in alphabetical order.

If the vendor is intended to be used to purchase items, you may wish to set the vendor to a depositor in the vendor settings, this will display the input item in the display case and change the vendor's appearance to make it clear to potential sellers the vendor's purpose. The previous example vendor set to a depositor can be seen below:

A player depositor

Buying items

Regular players who can't access a fancy vendor's inventory or configuration will be displayed a purchase screen when they access a vendor. This screen displays vendor information and status, as well as buying options. Unlike many vendor mods, fancy vendors give buyers to buy multiple "lots" at once. Doing this can save a lot of clicking, as the number of input and output items traded is multiplied by this number.

There is also a button labeled "Fill lots to max" which will pre-load the lots field with the maximum number of lots that the player can purchase from the vendor (which will be either the maximum the player can afford, or the maximum the shop can sell, whichever is smaller).

An example image of the buyer formspec can be seen below:

Buying from a fancy vendor

Advanced settings

Fancy vendors have many additional options which enable sellers to greatly customize vendors.

Fancy Vendor settings

Banned Buyers: This field is a list of players (separated by commas) who won't be able to purchase from the vendor. This setting might be useful if you wish to stop players buying out your vendor's stock and reselling it for a higher margin.

Co-Sellers: This field is a list of players (separated by commas) who will be able to access the vendor's inventory. Please note: Anyone added to the list has full access to the vendor's inventory, however cannot modify the vendor settings nor dig the vendor.

Buy/sell worn tools: These options allow for the seller to stop the vendor from purchasing or selling worn tools. A message will display on the buyer formspec if one of these options is disabled.

Inactive force: While the seller is reconfiguring a vendor, or in the process of creating a shop, the owner might wish for the vendor to be inactive so players cannot purchase from it, in which case they can enable this option.

Autosort: If this option is enabled, the vendor's inventory will automatically sort when the vendor formspec is closed by someone who can access the inventory.

Logs: The logs formspec displays the 40 most-recent transactions. While only people who can modify the vendor are allowed to access this formspec, these logs are kept in metadata which could be easily read client-side.

Geminio Wand: This tool can be used to easily copy vendor settings from one vendor to another. Simply right click a vendor with it to copy the settings to the tool, and left click any other vendor to set that vendor's settings. The Geminio Wand will not copy input and output items nor quantities. You must be able to modify the settings of the vendor to do this. You can craft one with the following recipe:

Crafting a Geminio Wand

Automation

Fancy Vendors are digilines and pipeworks compatible, enabling the creation of highly automated shops.

Pipeworks

Fancy vendors connect to pipeworks devices from the bottom, rear and sides. When the optional pipeworks dependancy is satisfied, a number of pipeworks-specific options will also appear in the settings menu:

Pipeworks Settings

Split incoming stacks: This option enabled incoming stacks from pipeworks tubes to be split if only some of the stack can be accepted.

Eject incoming currency: When this option is enabled, the input items will be sent out of the bottom of the fancy vendor instead of being added to the vendor's internal inventory.

Accept output only: When this option is enabled, incoming items which aren't the output item will be rejected and not added to the vendor's inventory.

Hoppers

Fancy vendors are MCL hopper compatible. Also they have been tested to work with TenPlus1's hopper mod however should work with all hopper mods and forks. Hoppers can filter into vendors from the sides, however cannot be drained from the bottom as hoppers are protected and Fancy Vendors are locked. However, the shop owner is given the Eject incoming currency option which operates on hoppers similarly to how it does on pipeworks, by manually adding incoming currency to the inventory of a hopper placed below the vendor (or into the vendor's inventory if the hopper is full). Due to API limitations, Accept output only is not hopper-compatible and Split incoming stacks is not necessary.

Digilines

Fancy vendors are digilines compatible. When the digilines dependency is satisfied, an option to set the digiline channel will appear in settings. If this channel is set, every purchase will result in the following table being sent over that channel:

local msg = {
    buyer = player:get_player_name(), -- Purchaser's playername
    lots = lots, -- Number of lots purchased
    settings = settings, -- The settings table
}

The default settings table can be seen below:

local settings_default = {
    input_item = "",
    output_item = "",
    input_item_qty = 1,
    output_item_qty = 1,
    admin_vendor = false,
    depositor = false,
    currency_eject = false,
    accept_output_only = false,
    split_incoming_stacks = false,
    inactive_force = false,
    accept_worn_input = true,
    accept_worn_output = true,
    digiline_channel = "",
    co_sellers = "",
    banned_buyers = "",
}

Fancy Vendors and Fancy Vendor Display Nodes conduct digiline signals also.

This feature could theoretically make rewards-based shops feasable.

Out Of Stock Mail

This mod integrates with Athous Mail Mod to alert shop owners when their shops lose stock. When a vendor empties, the mod sends mail telling them that their vendor is out of stock. In the event another mod empties, the previous message will be edited so as to avoid flooding their inbox if they have many vendors.

Upgrading vendors

NOTE: If you wish to simply run this mod in parallel with existing vendor mods, simply load this mod (no configuration required)

Many servers already have vendor mods in place. Fancy Vend makes it easier for servers to upgrade with it's unique upgrading system. Fancy Vend will replace vendors from the supported vendor mods (money, vendor, easyvend and currency) with upgrade nodes. Upgrade nodes allow for sellers to empty the old node's inventory (if applicable), dig the upgrade node (which will drop a regular vendor) and set up a new shop. if a user tried to place an upgrade node, the stack is turned into a stack of regular vendors.

Since upgrade functionality can be achieved without the old mod loaded, the server owner must add the old vendor mod's name to minetest.conf as follows:

fancy_vend_old_vendor_mods = money

If there are multiple vendor mods the the owner wishes to enable this functionality on, they can add several mods to the list, separating each mod name with commas as follows:

fancy_vend_old_vendor_mods = emeraldbank,money,vendor,easyvend

If the owner wishes to keep the mod loaded, but still replace vendor nodes, the will need to add the mod to both minetest.conf and mod.conf.

Vendor upgrade:

Vendor upgrade

User Commands

User /pay command. Pay emeralds to another player:

/pay <player> <num>

User /money command. Show you the emeralds in your bank account in the chat.

/money

Administration

EmeraldBank mod also include a variety of tools for server administrators.

Admin Emerald command Admin command to add emeralds in bank accounts:

/emeralds <player> <num>

Add <num> emeralds to <player> account.

If num is 0 return emeralds in player account.

Temporarily disabling vendors: Any player with the disable_vendor privilege can run

/disable_all_vendors

to force all vendors into an inactive state. Please use this if you find a dangerous bug and are waiting for it to be fixed.

Admin vendors: Admin vendors perform the same role as their regular counterparts, however they do so with no stock or inventory requirements, simply creating and destroying items as players purchase.

Since incorrectly configured admin vendors could be easily used to duplicate items, the admin_vendor privilege is required for the option to switch a vendor to one appears. If the user is ever revoked this privilege, all admin vendors they own will be forced into an inactive state until the privilege is re-granted or the vendor is set to a player vendor.

Modifying vendors: If a user has the protection_bypass privilege, they will be able to access the full extent of the vendor as if they were the owner, including inventory and settings.

Server and client load: Fancy vend uses only one infrequent abm to refresh vendor objects in the event of a clearobjects. No other vendor updating is done unless a player purchases from the vendor or adjusts settings.

Note: Some clients using mobile and/or older devices, including PCs, may experience additional lag if many fancy vendors are used in a small space, however not to an extent greater than the majority of shops where players use itemframes or pedestals to achieve the same functionality as the fancy vendor's display.

More Info

This mod is for MineClonia or MineClone2 Games, dont work with MTG

Feel free to contribute, send MR/PR or issues.

Forum thread:

https://forum.gnuhacker.org/d/4-minetest-mod-emeraldbank