Hello. I'd like to introduce you a tool which was created to improve trading experience at minecraft servers. It was developed by me for my friends, but I guess it can be usefull for someone else, so I decided to post it here. It consists of 2 separate parts:
This is a simple static single page site for searching through the minecraft server trades. It is based on angular 1.5.0, ui-select 0.19.8, and a few my own scripts for data loading and multilanguage support.
Originally it was created to support QuickShop spigot plugin, but it doesn't depend on it, or its database table structures, so it can be used with anything else. Here is a short explanation of how it is works:
When you chose any item in the search bar js application sends GET request(with minecraft item id as a parameter) on the server and expects to receive a json object as a response, which will be parsed and showed on the page.
As already mentioned, this is just a static html page with a few js scripts, so it can't get data from your database. The only thing it does to load data is a "GET" request to a server, so you should provide a server app with all server logic, which will provides json object with trades as a response. By default, it loads pre generated static json file demo.json so you need to set a correct link in the configuration file - configs.js.
It provides you a multiple language support. All localized strings stores in json files in data directory. You can find default language configuration option in the configuration file - configs.js. At the same time you can choose language manually by adding "?lang=YOUR_LANGUAGE_SHORTCUT" ( "?lang=en" as for example ) to the end of page url.
As already was mentioned there are a few configuration options, which should allow you to simplify adjusting of this site to your server and requirements. Here is a link to the configuration file - configs.js.
link - link to the Get endpoint which will be used to load trades data from your server
lang - localization which will be loaded and used by default
showPrice - this option allows you to disable to show prices(it doesn't affect server side application)
map - a set of options which will be used to automatically generate links on the map. It is designed for usage with Dynmap
2. Server application
This is a server side application for the MineTrades site. It provides you a rest Get endpoint to request all required data about trades on your server. This application designed to be used with QuickShop and LuckPerms spigot plugins, or, to be more correct, with their databases.
This application provides you a single Get endpoint:
"item" is a required parameter, but "enchantment" is optional and should be used only for enchanted books(in other cases it will be ignored)
To make it easier for you almost all important things can be configured in "application.yml" file in "configs" section. For sure some of them, such as database connection parameters should be changed by you, but other params are optional and has default values. Alternatively, instead of any modifications in the sources, you can provide those params at the application start up.
To build application run next command(be sure you have Gradle 5 and Java 8):
Alternatively you can use one of the builds from Releases section on the github page of the repository. To run application run next command(be sure you have Java 8):
java -jar APPLICATION_JAR_NAME.jar
Also, as already said, you can provide all configuration params at the application start up. All of them are optional(in case of lack of some the default parameters from "application.yml" will be used). Just add next text at the end of previous command:
You are free to use it in any way you want, I do not need anything in exchange.