RedShop [1.16.5 - 1.21] SELL REDSTONE SIGNAL FOR MONEY! icon

RedShop [1.16.5 - 1.21] SELL REDSTONE SIGNAL FOR MONEY! -----

Shop system for commercial redstone machines & itemframe items




1RedShop.png

Do you want players to be able to create commercial redstone machines? Do you have a server using special rare items? This plugin is for you!

Wiki
: https://foresttech.gitbook.io/redshop


[​IMG]
[​IMG]

[​IMG]
  • FrameShop module allows players to sell items in itemframe above the sign
  • RedClick shop module allows players to “sell” redstone signal which can activate redstone circuit
  • Almost everything is configurable
  • Per-module settings
  • Multi-currencies support (see Supported currencies)
  • Custom currency names and symbols
  • Well optimized code
  • Admins can deactivate shop signs
  • Every single message is translatable
  • RGB support
  • Discord logger
  • Custom date and price formats
  • Offline payments support for all currencies (including these who doesn’t provide offline transactions)
[​IMG]
If you want us to add your currency to this list, tell us :)
  • Experience points
  • Vault (Economy plugin like Essentials/CMI needed!)
  • TokenManager
  • PlayerPoints
  • BeastTokens
  • Or use our API to implement your own :)

[​IMG]
  • Put RedShop.jar into your plugins folder
  • Restart server
  • Edit config files in plugins/RedShop directory (see Configuration below)
  • Restart server OR reload plugin using /redshop reload all command
[​IMG]
Here are default configuration files. Note! Do not edit pending.yml as it is offline player's cache!

Code (Text):

#############################################
#
#     General Configuration file
#
#############################################

# What language should be used
# Uses file messages_'lang'.yml.
# You can copy messages_en.yml and translate it yourself (or use one of our premades)
# If the file doesn't exist, english file is used instead.
lang: en

# How the date should be displayed
# Check for more info: https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
# This will write date in following format: 28.03.2021 14:54:22
dateFormat: "dd.MM.yyyy HH:mm:ss"

# How the price should be displayed
# Formats' examples:
# 1) XXX,XXX.### (e.g. 154,798.20 $) - default
# 2) XXX XXX,### (e.g. 154 798,20 $)
# 3) XXX.XXX,### (e.g. 154.798,20 $)
# 4) XXX XXX.### (e.g. 154 798.20 $)
priceDisplayFormat: 1

# List of supported currencies. You can register your own currency using RedShop API
# Make sure the corresponding plugin is installed and enabled on your server before enabling
currencies:
  # Default currency used by Vault plugin (required economy plugin, such as CMI/Essentials etc.)
  vault:
    # Whether the Vault currency should be enabled
    enabled: true
    # Display name of the currency (!must be unique!)
    # Full name is used in signs as display name of the currency
    # The value is case-sensitive
    # NOTE! If you change this line, already existing signs won't work anymore!!!
    fullname: "Dollars"
    # Symbol of the currency (!must be unique!)
    # Currency symbol can be also used as alias in shop sign creation
    # The value is case-sensitive
    symbol: "$"
    # List of aliases used by players in shop signs (!must be unique!)
    # The value is case-insensitive
    # After sign is created, the alias will be updated to fullname
    aliases:
      - "dollars"
      - "dol"
  # Experience points as currency (requires nothing else)
  exp:
    enabled: true
    fullname: "Experience"
    symbol: "EXP"
    aliases:
      - "xp"
      - "exp"
  # TokenManager plugin integration (requires TokenManager installed)
  tokenmanager:
    enabled: false
    fullname: "TokenManager"
    symbol: "TM"
    aliases:
      - "tm"
  # PlayerPoints plugin integration (requires PlayerPoints installed)
  playerpoints:
    enabled: false
    fullname: "PlayerPoints"
    symbol: "PP"
    aliases:
      - "plpoints"
  # BeastTokens plugin integration (requires BeastTokens installed)
  beasttokens:
    enabled: false
    fullname: "BeastTokens"
    symbol: "BT"
    aliases:
      - "btoken"
      - "btokens"

# Supported modules
modules:
  frameshop: true
  redclick: true
 
Code (Text):

######################################################
#
#     Configuration section for FrameShop
#
######################################################

# List of allowed currencies for this module which can be customized in config.yml
# NOTE! DO NOT USE fullName AS IDENTIFIER HERE - Use the name in the config section (vault instead of "Dollars")
currencies:
  - "vault"
  - "tokenmanager"
  - "playerpoints"
  - "beasttokens"
  - "exp"

# Default currency used if player doesn't fill the currency line
# Note! Selected currency must be enabled in the currencies list! Otherwise it won't work!
defaultCurrency: "vault"

# Discord logger configuration
discordLogger:
  # Enable Discord logging
  enabled: false
  # Webhook URL (find more here: https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks)
  webhook: https://discord.com/api/webhooks/WEBHOOK_CODE_HERE
  # List of logged events
  loggedEvents:
    shopCreate: false
    shopRemove: false
    shopBuy: false
 
Code (Text):

######################################################
#
#     Configuration section for RedClick
#
######################################################

# List of allowed currencies for this module which can be customized in config.yml
# NOTE! DO NOT USE fullName AS IDENTIFIER HERE - Use the name in the config section ("vault" instead of "Dollars")
currencies:
  - "vault"
  - "tokenmanager"
  - "playerpoints"
  - "beasttokens"
  - "exp"

# Default currency used if player doesn't fill the currency line
# Note! Selected currency must be enabled in the currencies list! Otherwise it won't work!
defaultCurrency: "vault"

# How long will the signal be present after activation in ticks (default: 1, min: 1, max: 40)
# Note! Higher values can make the substitute redstone block destroyable!
signalDurationTicks: 1

# Discord logger configuration
discordLogger:
  # Enable Discord logging
  enabled: false
  # Webhook URL (find more here: https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks)
  webhook: https://discord.com/api/webhooks/WEBHOOK_CODE_HERE
  # List of logged events
  loggedEvents:
    shopCreate: false
    shopRemove: false
    shopBuy: false
 
Code (Text):

#############################################
#
#     General messages
#
#############################################

noPermissions: "{#660000>}&lRedShop{#BA0101<} &8&l>> &cYou don't have enough permissions!"
reloadAll: "{#660000>}&lRedShop{#BA0101<} &8&l>> &7Successfully reloaded all components!"
reloadConfig: "{#660000>}&lRedShop{#BA0101<} &8&l>> &7Successfully reloaded config file!"
reloadMessages: "{#660000>}&lRedShop{#BA0101<} &8&l>> &7Successfully reloaded messages file!"
reloadModule: "{#660000>}&lRedShop{#BA0101<} &8&l>> &7Successfully reloaded %module_name% module!"
reloadWrongModule: "{#660000>}&lRedShop{#BA0101<} &8&l>> &7Module with name %module_name% does not exist!"

#############################################
#
#     FrameShop's messages
#
#############################################

frameshop:
  noMoney: "&3&lFrameShop &8&l>> &cYou don't have enough money!"
  fullInventory: "&3&lFrameShop &8&l>> &cYour inventory is full!"
  wrongCurrency: "&3&lFrameShop &8&l>> &cThere's no supported currency with this name!"
  wrongPrice: "&3&lFrameShop &8&l>> &cYou entered wrong price format!"
  missingFrame: "&3&lFrameShop &8&l>> &cYou need to put itemframe with item above the sign!"
  missingItem: "&3&lFrameShop &8&l>> &cYou need to put item in the itemframe above the sign!"
  onlyLeftClick: "&3&lFrameShop &8&l>> &7Use &bleft click &7to buy!"
  onlyLeftShiftClick: "&3&lFrameShop &8&l>> &7Use &bleft+shift click &7to remove the shop!"
  created: "&3&lFrameShop &8&l>> &7Shop successfully &acreated&7!"
  removed: "&3&lFrameShop &8&l>> &7Shop successfully &cremoved&7!"
  # You can use %item_type%, %owner% and %price% placeholders
  bought: "&3&lFrameShop &8&l>> &7You bought &d%item_type% &7from &d%owner% &7for &d%price%&7!"
  # You can use %item_type%, %consumer% and %price% placeholders
  sold: "&3&lFrameShop &8&l>> &7You sold &d%item_type% &7to &d%consumer% &7for &d%price%&7!"
  # Editing sign display - NOTE! Changing some of these lines may break compatibility with older versions
  signs:
    # What players shall write on first sign line (DOES NOT effect already existing shops)
    headerIdentification: "FrameShop"
    # After creation, what appears in first line (already existing shops !MAY NOT WORK! after editing)
    headerLineDisplay: "&3&lFrameShop"
    # Currency display line (you can use %fullname% OR %symbol% placeholder)
    # Note! Do not add additional text! If you do so, plugin won't know what currency should it use!!!
    currencyLine: "&l%fullname%"
    # If buyer tries to buy something from invalid shop, sign header will change to this (DOES NOT effect already existing shops)
    errorHeaderLine: "&3&l&mFrameShop"
    # If item is sold, sign header will change to this (DOES NOT effect already existing shops)
    soldHeaderLine: "&3&l&mFrameShop"
    # Line saying who bought it (DOES NOT effect already existing shops)
    boughtByLine: "Bought by:"
    # In following section, only one line-end (use '%nl%') is acceptable (message can use only last two lines of the sign)
    wrongFrame: "&cError while%nl%&cloading frame"
    wrongItem: "&cError while%nl%&cloading item"
    wrongPrice: "&cError while%nl%&cloading price"
    wrongDefault: "&cError while%nl%&cloading data"

#############################################
#
#     RedClick's messages
#
#############################################

redclick:
  noMoney: "&4&lRedClick &8&l>> &cYou don't have enough money!"
  wrongCurrency: "&4&lRedClick &8&l>> &cThere's no supported currency with this name!"
  wrongPrice: "&4&lRedClick &8&l>> &cYou entered wrong price format!"
  wrongBlock: "&4&lRedClick &8&l>> &cThere's invalid attached block type!"
  missingBlock: "&4&lRedClick &8&l>> &cThere's no attached block!"
  onlyLeftClick: "&4&lRedClick &8&l>> &7Use &cleft click &7to buy!"
  onlyLeftShiftClick: "&4&lRedClick &8&l>> &7Use &cleft+shift click &7to remove the shop!"
  created: "&4&lRedClick &8&l>> &7Shop successfully &acreated&7!"
  removed: "&4&lRedClick &8&l>> &7Shop successfully &cremoved&7!"
  delay: "&4&lRedClick &8&l>> &7You have to wait before next activation!"
  testActivation: "&4&lRedClick &8&l>> &7Test activation executed!"
  # You can use %item_type%, %owner% and %price% placeholders
  bought: "&4&lRedClick &8&l>> &7You activated RedClick &7from &c%owner% &7for &c%price%&7!"
  # You can use %item_type%, %consumer% and %price% placeholders
  sold: "&4&lRedClick &8&l>> &c%consumer% &7activated your RedClick for &c%price%&7!"
  signs:
    # What players shall write on first sign line (DOES NOT effect already existing shops)
    headerIdentification: "RedClick"
    # After creation, what appears in first line (already existing shops !MAY NOT WORK! after editing)
    headerLineDisplay: "&4&lRedClick"
    # Currency display line (you can use %fullname% OR %symbol% placeholder)
    # Note! Do not add additional text! If you do so, plugin won't know what currency should it use!!!
    currencyLine: "&l%fullname%"
    # If buyer tries to buy something from invalid shop, sign header will change to this (DOES NOT effect already existing shops)
    errorHeaderLine: "&4&l&mRedClick"
    # In following section, only one line-end (use '%nl%') is acceptable (message can use only last two lines of the sign)
    wrongPrice: "&cError while%nl%&cloading price"
    wrongBlock: "&cError while%nl%&cloading block"
    missingBlock: "&cNo attached%nl%&cblock found"
    wrongDefault: "&cError while%nl%&cloading data"

#############################################
#
#     Discord messages
#
#############################################

discord:
  frameshop:
    create: "FrameShop created"
    createDesc: "Player created a new FrameShop"
    remove: "FrameShop Removed"
    removeDesc: "Player removed a FrameShop"
    purchase: "FrameShop Purchase"
    purchaseDesc: "Player bought item in FrameShop"
  redclick:
    create: "RedClick created"
    createDesc: "Player created a new RedClick"
    remove: "RedClick Removed"
    removeDesc: "Player removed a RedClick"
    purchase: "RedClick Purchase"
    purchaseDesc: "Player bought signal in RedClick"
  buyer: "Buyer"
  seller: "Seller"
  player: "Player"
  location: "Location"
  itemType: "ItemType"
  price: "Price"
  date: "Date"


[​IMG]
Code (Text):
# Default command
/redshop
# Info about plugin (version, authors)
/redshop info
# Reloading commands
/redshop reload [all | config | messages | frameshop | redclick]
Code (Text):
# Allows /redshop commands
redshop.admin

# Allows to create FrameShop with selected currency
redshop.frameshop.create.<currency_name>
# Allows to create FrameShop with all currencies
redshop.frameshop.create.*
# Allows to remove/deactivate others FrameShops
redshop.frameshop.remove.others

# Allows to create RedClick with selected currency
redshop.redclick.create.<currency_name>
# Allows to create RedClick with all currencies
redshop.redclick.create.*
# Allows to remove/deactivate others RedClicks
redshop.redclick.remove.others


[​IMG]
Note!!! Shop signs ARE NOT protected by this plugin! You have to have your own protection system like Residence/Towny! If the sign/itemframe is accessible to other players, they can destroy it or steal the item!

Why? If we implement our own protection system, it may collide with other protection plugins and we cannot guarantee it will work in all circumstances.


FrameShop works like chest shop, but instead of chest, it sells item in itemframe placed above. Players can use this for selling rare/special items with custom lore, so customers can see what are they buying in very spectacular way.

frameshopsign.png
Code (Text):
1st line (configurable in frameshop.yml): FrameShop
2nd line: EMPTY
3rd line: price (e.g. 22.5, 50, etc.)
4th line: currency name/symbol (if empty, defaultCurrency is used)
RedClick sign works as "smart button". If someone clicks on the sign, it'll transfer currency between players and the sign will act as redstone signal source. Players can use this for redstone machines like rollercoasters, vending machines, etc.

redclicksign.png
Code (Text):
1st line (configurable in redclick.yml): RedClick
2nd line: EMPTY
3rd line: price (e.g. 22.5, 50, etc.)
4th line: currency name/symbol (if empty, defaultCurrency is used)

[​IMG]

We also provide API for this project! Using our API, you can implement your own currency! Here's how to use it!

ExampleCurrency.java
Code (Java):
/**
*  Your currency object needs to extend SupportedCurrency abstract class
*/

public class ExampleCurrency extends SupportedCurrency {

    //Your economy class
    private ExampleEconomy myEconomy ;

    /**
     *  Currency constructor. You can use your own variables if needed.
     *
     *  Fun-fact: Check config.yml - you can see we use the same system for pre-defined currencies
     */

    public ExampleCurrency ( ) {
        //Calling abstract class constructor - REQUIRED!
        super (
            "ExampleDollars", //used as display name on signs, MUST BE UNIQUE!
            true, //if the currency is available (enabled)
            "$", //symbol used as suffix in messages, MUST BE UNIQUE!
            Arrays. asList ( "dol", "doll" ), //list of aliases players can use instead of fullname, MUST BE UNIQUE!
            false, //if the currency/economy can handle offline player transactions - if not, we'll use pending.yml file to store the pending payments until player joins
            "ExampleCurrency" //system name of the currency (usually name of the plugin), MUST BE UNIQUE!
        ) ;

        if (enabled ) {
            //Setup your economy
            myEconomy = MyPlugin. getMyEconomy ( ) ;
            if (myEconomy == null ) {
                enabled = false ;
            }
        }
    }

    /**
     *   Shall the currency use double or integer?
     *
     *   true = allows prices with decimal (e.g. 15.56)
     *   false = allows only integer prices (e.g. 15)
     */

    @Override
    public boolean useDoubleValues ( ) {
        return true ;
    }

    @Override
    public double getAmount (OfflinePlayer offlinePlayer ) {
        if ( !enabled ) {
            return 0 ;
        }
        //Plugin checks balance of only online players, so we can cast it to Player
        return myEconomy. getBalance ( (Player ) offlinePlayer ) ;
    }

    @Override
    public boolean giveAmount (OfflinePlayer offlinePlayer, double amount ) {
        if ( !enabled ) {
            return false ;
        }
        //If the seller is offline and currency cannot pay offlinePlayer, we need to handle it
        if ( !offlinePlayer ( ). isOnline ( ) && !offlineReady ( ) ) {
            //API method saves the amount to pending.yml and auto-pays the amount when the player joins
            return giveOffline (offlinePlayer, amount ) ;
        }
 
        //Otherwise, OfflinePlayer is online, so we can cast it to Player
        return myEconomy. depositPlayer (offlinePlayer. getPlayer ( ), amount ). transactionSuccess ( ) ;
    }

    @Override
    public boolean takeAmount (OfflinePlayer offlinePlayer, double amount ) {
        if ( !enabled ) {
            return false ;
        }
        //Plugin takes money only from online players, so we can cast it to Player
        return myEconomy. withdrawPlayer ( (Player ) offlinePlayer, amount ). transactionSuccess ( ) ;
    }

}
In Main.java
Code (Java):
@Override
public void onEnable ( ) {
    //... Your stuff ...
    if (setupCurrency ( ) ) {
        this. getServer ( ). getConsoleSender ( ). sendMessage ( "Custom RedShop currency successfully registered!" ) ;
    } else {
        this. getServer ( ). getConsoleSender ( ). sendMessage ( "Custom RedShop currency registration failed!" ) ;
    }
    //... Your other stuff ...
}

/**
 *   setupCurrency method registers your currency to RedShop
 *
 *   Choose ONE of the method below - both does the same thing
 */

private boolean setupCurrency ( ) {
    /* METHOD ONE */
    ExampleCurrency customCurrency = new ExampleCurrency ( ) ;
    return customCurrency. register ( ) ;

    /* METHOD TWO */
    RedShop redShopAPI = this. getServer ( ). getPluginManager ( ). getPlugin ( "RedShop" ) ;
    if (redShopAPI == null || redShopAPI. isEnabled ( ) ) {
        //RedShop is not installed OR is disabled
        return false ;
    }
    return redShopAPI. registerCurrency ( new ExampleCurrency ( ) ) ;
}

[​IMG]
  • Own protection system which won't collide with other plugins (10 % progress)
[​IMG]
Like everyone else, we have some conditions in order to use our plugin.
  • You won't decompile the code without our permission
  • You won't redistribute or upload the plugin or it's files without our permission
  • You won't provide access to download the plugin to others
  • You can use the plugin on all servers you have
  • No refunds
[​IMG]

If you have any questions / suggestions / need support, contact us on Discord!

Please, DO NOT report bugs or ask for support in review section!
Discord support is the fastest way and we'll be glad to help you!

[​IMG]

[​IMG]

[​IMG] [​IMG]
[​IMG][​IMG]
Resource Information
Author:
----------
Total Downloads: 41
First Release: Oct 15, 2021
Last Update: Aug 21, 2024
Category: ---------------
All-Time Rating:
4 ratings
Find more info at foresttech.gitbook.io...
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings