Download Lightman's Currency x CC:Tweaked Compat — Minecraft Mods — MetaMods

Lightman's Currency x CC:Tweaked Compat

Active

Downloads

0

Last update

4 months ago

Versions

1.20.1
Client and server
Forge
Economy
Technological
Utils
Addons

Lightman's Currency x CC:Tweaked Compat

This modification provides seamless integration of the Lightman's Currency module with the CC:Tweaked computer system through Lua programming language. To get started, simply place a computer near Lightman's Currency trade blocks and connect them as peripheral devices.

Main Functions

When connecting a trade terminal to a computer, the following Lua functions become available:

  • getName(trader) - returns the custom name of the trader
  • getOwnerName(trader) - shows the name of the trade point owner
  • getTrades() - provides a complete list of available deals with detailed information:
    • items - list of goods indicating item type and quantity
    • transactionType - operation type (sale, purchase, or exchange)
    • price - cost in currency for buy/sell transactions
    • itemsCost - required items for exchange operations

Example Program Code

local p = peripheral.wrap("back") -- specify the peripheral connection side
local traders = p.getTrades()

for , trader in ipairs(traders) do
    print("Trader:", trader.name, "(ID:", trader.id .. ")")
    if #trader.trades == 0 then
        print("  No available deals.")
    else
        for i, trade in ipairs(trader.trades) do
            print("  Deal " .. i .. ":")
            print("    Type:", trade.transactionType)
            if trade.price then
                print("    Price:", trade.price)
            end
            if trade.items then
                print("    Goods:")
                for , item in ipairs(trade.items) do
                    print("      -", item.count, item.item)
                end
            end
            if trade.itemsCost then
                print("    Exchange Cost:")
                for _, item in ipairs(trade.itemsCost) do
                    print("      -", item.count, item.item)
                end
            end
        end
    end
    print()
end
Project members
efraimg

efraimg

Developer

Easease

Easease

Developer

Created: 6 Jun 2025

ID: 222764