Skip to content

Commit

Permalink
Version 1.1.0
Browse files Browse the repository at this point in the history
- MySQL support
- Updated InvMenu to 3.0
- Added price range for listings (#20)
- Fixed startup error on Linux servers
- Added Russian language
  • Loading branch information
Shock950 committed Jun 14, 2020
1 parent 5754d79 commit 388cb0b
Show file tree
Hide file tree
Showing 14 changed files with 410 additions and 158 deletions.
4 changes: 2 additions & 2 deletions .poggit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ projects:
icon: icon.png
libs:
- src: poggit/libasynql/libasynql
version: ^3.2.0
version: ^3.3.0
- src: muqsit/InvMenu/InvMenu
branch: master
version: 2.1.0
version: 3.1.0
- src: SOF3/await-generator/await-generator
version: ^2.2.0
- src: JackMD/UpdateNotifier/UpdateNotifier
Expand Down
131 changes: 70 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,72 @@
# AuctionHouse [![](https://poggit.pmmp.io/shield.state/AuctionHouse)](https://poggit.pmmp.io/p/AuctionHouse) [![](https://poggit.pmmp.io/shield.dl.total/AuctionHouse)](https://poggit.pmmp.io/p/AuctionHouse)

Feature-packed AuctionHouse plugin for PocketMine-MP

## Overview
AuctionHouse allows players to list their items for sale and purchase items that others have listed for sale.

![AuctionHouse](https://github.com/Shock95x/AuctionHouse/blob/master/img/auctionhouse.png)
---
## Features
>- Chest GUI
>- Config (See below)
>- Multi-lang support
>- Custom Events
>- Economy plugin support (EconomyAPI as of now)
>- SQLite database support (MySQL coming soon)
>- Customizable messages
- And more coming soon!
---
## Download
Check the [releases tab](https://github.com/Shock95x/AuctionHouse/releases) or [PoggitCI](https://poggit.pmmp.io/ci/Shock95x/AuctionHouse/AuctionHouse/)

---
## Config
```yaml
---
# DO NOT EDIT THIS VALUE, INTERNAL USE ONLY.
config-version: 1
# Sets the prefix for this plugin.
prefix: "[&l&6Auction House&r]"
# Sets the default language for the plugin, you can edit text and messages in this file.
default-language: en-US
# Sets the amount of hours a listing is active before being automatically cancelled and expired.
expire-interval: 48
# Sets the price it costs to list one item on the auction house.
listing-price: 0
# Allows or blocks players in creative mode from selling items.
creative-sale: false
# The maximum amount of listings a player can have.
max-items: 45
# Items that cannot be listed on the auction. Refer to https://minecraftitemids.com/ or https://minecraft-ids.grahamedgecombe.com/ for a list of item ids.
blacklist:
- '1000' #Example items, these items dont exist in MC, but you should use ones that do if you want.
- '1001:12'
Feature-packed AuctionHouse plugin for PocketMine-MP

## Overview
AuctionHouse allows players to list their items for sale and purchase items that others have listed for sale.

![AuctionHouse](https://github.com/Shock95x/AuctionHouse/blob/master/img/auctionhouse.png)
---
## Features
>- Chest GUI
>- Config (See below)
>- Multi-lang support
>- Custom Events
>- Economy plugin support (EconomyAPI as of now)
>- MySQL and SQLite database support
>- Customizable messages
- And more coming soon!
---
## Download
Check the [releases tab](https://github.com/Shock95x/AuctionHouse/releases) or [PoggitCI](https://poggit.pmmp.io/ci/Shock95x/AuctionHouse/AuctionHouse/)

---
## Config
```yaml
---
# DO NOT EDIT THIS VALUE, INTERNAL USE ONLY.
config-version: 3
# Sets the prefix for this plugin.
prefix: "[&l&6Auction House&r]"
# Minimum price required to create a listing
min-price: 0
# Maximum price a listing can have (-1 = No limit)
max-price: -1
# Sets the default language for the plugin, you can edit text and messages in this file.
default-language: en_US
# Sets the amount of hours a listing is active before being automatically cancelled and expired.
expire-interval: 48
# Sets the price it costs to list one item on the auction house.
listing-price: 0
# Allows or blocks players in creative mode from selling items.
creative-sale: false
# The maximum amount of listings a player can have.
max-items: 45
# Items that cannot be listed on the auction. Refer to https://minecraftitemids.com/ or https://minecraft-ids.grahamedgecombe.com/ for a list of item ids.
blacklist:
- '1000' #Example items, these items dont exist in MC, but you should use ones that do if you want.
- '1001:12'
- '12333:4'
...
```
---
## Commands

| Command | Description |
| ------------- |:--------------|
| /ah | AuctionHouse main command, opens the shop menu if there are no specified parameters |
| /ah shop | Opens the shop menu |
| /ah sell **[price]** | Allows player to list items in their hand on the auction house. **[price]** is the amount that the player is listing the item to sell for |
| /ah listings | Shows all active listings of the player|
| /ah update | Allows player to reload the config and save the database (OP command) |
| /ah about | Shows AuctionHouse version the server is running and author of this plugin |
---
## API
### Events
- [shock95x\auctionhouse\event\AuctionStartEvent](https://github.com/Shock95x/AuctionHouse/blob/master/src/AuctionHouse/event/AuctionStartEvent.php)
- [shock95x\auctionhouse\event\AuctionEndEvent](https://github.com/Shock95x/AuctionHouse/blob/master/src/AuctionHouse/event/AuctionEndEvent.php)
...
```
---
## Commands

| Command | Description |
| ------------- |:--------------|
| /ah | AuctionHouse main command, opens the shop menu if there are no specified parameters |
| /ah shop | Opens the shop menu |
| /ah sell **[price]** | Allows player to list items in their hand on the auction house. **[price]** is the amount that the player is listing the item to sell for |
| /ah listings | Shows all active listings of the player|
| /ah update | Allows player to reload the config and save the database (OP command) |
| /ah about | Shows AuctionHouse version the server is running and author of this plugin |
---
## API
### Events
- [shock95x\auctionhouse\event\AuctionStartEvent](https://github.com/Shock95x/AuctionHouse/blob/master/src/AuctionHouse/event/AuctionStartEvent.php)
- [shock95x\auctionhouse\event\AuctionEndEvent](https://github.com/Shock95x/AuctionHouse/blob/master/src/AuctionHouse/event/AuctionEndEvent.php)

## Contributing
You can contribute to this project by creating a new language file and opening a PR!
### Supported languages
- [Shock95x](https://github.com/Shock95x) (English)
- [No4NaMe](https://github.com/No4NaMe) (Russian)
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: AuctionHouse
main: shock95x\auctionhouse\AuctionHouse
version: 1.0.9
version: 1.1.0
api: 3.0.0
author: Shock95x
softdepend: [EconomyAPI]
Expand Down
6 changes: 5 additions & 1 deletion resources/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
---
# DO NOT EDIT THIS VALUE, INTERNAL USE ONLY.
config-version: 2
config-version: 3
# Sets the prefix for this plugin.
prefix: "[&l&6Auction House&r]"
# Minimum price required to create a listing
min-price: 0
# Maximum price a listing can have (-1 = No limit)
max-price: -1
# Sets the default language for the plugin, you can edit text and messages in this file.
default-language: en_US
# Sets the amount of hours a listing is active before being automatically cancelled and expired.
Expand Down
1 change: 1 addition & 0 deletions resources/language/en_US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ cannot-afford: "&6You do not have enough money to buy this item."
item-blacklisted: "&cThat item is not allowed to be put on the auction house!"
invalid-balance: "&cYou do not have enough money to list an auction."
listing-gone: "&cThis listing no longer exists."
price-range: "&cInvalid price range" #@min, @max

# Items in the menu UI
listed-item:
Expand Down
163 changes: 163 additions & 0 deletions resources/language/ru_RU.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
---
# Refer to https://minecraft.gamepedia.com/Formatting_codes for formatting codes, you can replace the '§' symbol with a '&'

# The titles of the Auction House UI
menu-name: "&l&6Аукционный дом"
listings-menu-name: "&6Активные списки"
expired-menu-name: "&6Отменен / Истекшие списки"
purchase-menu-name: "Подтвердите покупку"

# Chat messages
item-purchased: "&eТовар Куплен&e!"
buyer-purchased: "&6%покупатель% &eприобрёл ваш предмет за &6$%price%&e!"
item-listed: "&2Вы перечислили &d@item &r&d(x@amount) &2за &d@price. Тип &e/ah listings &dпросмотреть все ваши аукционы"
cancelled-item: "&eВы &6Отменили &eаукцион. Возврат отмененных и просроченных товаров по адресу &6/ah expired&e."
cancelled-purchase: "&cВы отменили эту покупку"
admin-removed: "&eСписок удален."
purchased-item: "&2Вы купили &d@item &r&d(x@amount) &2за &d@price" #@player, @item, @price, @amount
seller-message: "&e@Игрок приобрел @item (x@amount) ваш предмет за &d@price!" #@player, @item, @price, @amount
returned-item: "&2Вы удалили &d@item &r&d(x@amount) &2 из аукционного дома." #@item, @amount

# Error messages
in-creative: "&cВы не можете продавать предметы в творческом режиме."
max-listings: "&cВы не можете иметь более 45 активных аукционов."
invalid-price: "&cНеверная цена."
no_empty: "&cВаш инвентарь пуст."
not-enough-space: "Недостаточно места в инвентаре"
self-purchase: "&cВы не можете купить свои собственные вещи на аукционе!"
item-gone: "Этого предмета больше не существует"
no-item: "&cВы должны держать предмет в руке!"
cannot-afford: "&6У вас недостаточно денег, чтобы купить этот предмет."
item-blacklisted: "&cЭтот предмет не может быть выставлен на аукцион!"
invalid-balance: "&cУ вас недостаточно денег, чтобы выставить предмет на аукцион."
listing-gone: "&cЭтого списка больше не существует."

# Items in the menu UI
listed-item:
# %price% = Цена листинга
# %seller% = Имя продавца
# %expire% = Время до истечения срока листинга
- "&7-------------------------"
- "&aНажмите здесь, чтобы купить."
- ""
- "&9Цена: &e$%price%"
- "&9Продавец: &e%seller%"
- "&9Истекать: &e%time%"
- "&7-------------------------"
your-listed-item:
# %price% = Цена аукциона
# %expire% = Время до истечения срока аукциона
- "&7-------------------------"
- "&cНажмите здесь, чтобы отменить."
- ""
- "&9Цена: &e$%price%"
- "&9Истекает: &e%time%"
- "&7-------------------------"
view-listed-items:
# %selling% = Количество активных аукционов
id: 264
name: "&6Предметы, которые вы продаете"
lore:
- "&aНажмите здесь, чтобы просмотреть все предметы, которые вы"
- "&aв данный момент продаете на аукционе."
- ""
- "&9Продажа: &e%selling%"
view-expired-items:
# %expired% = Количество истекших аукционов
id: 394
name: "&6Собрать просроченные / отмененные предметы"
lore:
- "&r&aНажмите здесь, чтобы просмотреть и собрать все"
- "&aЭлементы, которые вы отменили или просрочели."
- ""
- "&9Предметы для сбора: &e%expired%"
previous-page:
id: "339"
name: "&a<- Предыдущая страница"
lore:
- "Перейти на предыдущую страницу"
next-page:
id: "339"
name: "&aСледующая Страница ->"
lore:
- "Перейти на следующую страницу"
back-button:
id: "339"
name: "&6Назад"
lore:
sell-description:
id: "388"
name: "&6Как продать предмет"
lore:
- "&aЧтобы выставить предмет на аукцион, просто удерживайте"
- "&aпредмет в вашей руке и введите &b/ah sell <цена>&a."
main-description:
id: "340"
name: "&6Что это за страница?"
lore:
- "&aЭто аукционный дом, здесь можно"
- "&aсписок предметов для продажи и покупки предметов"
- "&aчто другие выставили на продажу."
- ""
- "&aАукцион также отличный способ сделать"
- "&aденьги от продажи других товаров"
- "&aигроки могут быть заинтересованы в покупке."
main-stats:
# %page% = Текущая страница
# %max% = Макс страница
# %total% = Общее количество товаров
id: "54"
name: "&l&6Аукционный дом"
lore:
- "&aСтраница %page%/%max%"
- "&7Всего &b%total% &7предметов"
- "Нажмите, чтобы обновить страницу"
listings-description:
id: "340"
name: "&6Что это за страница?"
lore:
- "&aЭто ваши текущие списки, все"
- "&aпредметы, которые вы сейчас перечислили на"
- "&aаукционный дом отображаются здесь."
- ""
- "&aВы можете отменить и просмотреть свои списки"
- "&aистекает время здесь."
listings-stats:
# %page% = Текущая страница
# %max% = Последняя страница
# %total% = Общее количество объявлений
id: "54"
name: "&l&6Объявления"
lore:
- "&aСтраница %page%/%max%"
- "&7Всего &b%total% &7предметов"
expired-description:
id: "340"
name: "&6Что это за страница?"
lore:
- "&aЭта страница содержит все ваши отмененные"
- "&aпредметы с истекшим сроком, когда список отменен"
- "&aили истек срок действия, вы можете нажать возврат, что бы"
- "&aвернуться назад из этого меню."
- ""
- "&aПросто нажмите на элемент, и если у вас достаточно"
- "&aв инвентаре вы получите предмет."
expired-stats:
# %page% = Текущая страница
# %max% = Последняя страница
# %total% = Общее количество предметов
id: "152"
name: "&l&6Истекший"
lore:
- "&aСтраница %page%/%max%"
- "&7Всего &b%total% &7предметов"
purchase-confirm:
name: "&aПодтвердите покупку"
purchase-cancel:
name: "&cОтменить покупку"
purchaseItem:
lore:
- ""
- "&9Цена: &e$%price%"
- "&9Продавец: &e%seller%"
...
39 changes: 39 additions & 0 deletions resources/statements/mysql.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
-- #!mysql
-- #{ auctionhouse

-- # { init
CREATE TABLE IF NOT EXISTS auctions(
uuid VARCHAR,
username VARCHAR,
price INT,
nbt BLOB,
end_time INT,
expired BOOLEAN DEFAULT FALSE,
id INT PRIMARY KEY);
-- # }

-- # { fetch

-- # { all
SELECT * FROM auctions;
-- # }
-- # }

-- # { delete
-- # :id string
DELETE FROM auctions
WHERE id = :id;
-- # }

-- # { insert
-- # :uuid string
-- # :username string
-- # :price int
-- # :nbt string
-- # :id int
-- # :end_time int
-- # :expired bool
REPLACE INTO auctions(uuid, username, price, nbt, id, end_time, expired) VALUES (:uuid, :username, :price, :nbt, :id, :end_time, :expired)
-- # }

-- # }
Loading

0 comments on commit 388cb0b

Please sign in to comment.