Skip to content

Commit

Permalink
Merge pull request #23 from FoxWorn3365/pmmp5-dev
Browse files Browse the repository at this point in the history
Merge the dev version of pmmp5 into the main branch
  • Loading branch information
FoxWorn3365 authored Jul 23, 2023
2 parents 0f8876a + e78292d commit b82a44e
Show file tree
Hide file tree
Showing 24 changed files with 893 additions and 268 deletions.
52 changes: 45 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img src='https://raw.githubusercontent.com/FoxWorn3365/Shopkeepers/pmmp4-dev/plugin-banner.png'>
<img src='https://raw.githubusercontent.com/FoxWorn3365/Shopkeepers/resources/plugin-banner.png'><br>
<strong>Add Shopkeepers to your PocketMine-MP world! Allow the creation of simple barter stores between players or create adminshops!</strong>
<div align="center">
<a href="https://poggit.pmmp.io/p/Shopkeepers"><img src="https://poggit.pmmp.io/shield.state/Shopkeepers"></a>
Expand All @@ -16,21 +16,23 @@
</p>

---
<h1 align="center">Shopkeepers v0.9.1 for PocketMine-MP 5</h1>
<h1 align="center"><b>Shopkeepers v1.0</b> for PocketMine-MP 5</h1>
<br>

**⚠️ We are not in any way related to the [Shopkeepers plugin](https://dev.bukkit.org/projects/shopkeepers) for Bukkit!**

## Introduction video
<a href='https://www.youtube.com/watch?v=sustUWTgmMo'>Watch the video on YouTube</a>
<a href='https://youtu.be/FIAcOnTyW_Y'>Watch the video on YouTube</a>

## Features
- Players can create theyr own Shopkeepers and manage it
- Players can create their own Shopkeepers and manage it
- Admin Shopkeepers
- Vanilla trade page
- Shopkeeper inventory for non-admin Shopkeepers
- Hit prevention for shopkeepers
- Easy configuration with in-game GUI
- Double trade supported
- Custom skin support

## Compatibility
**Shopkeepers** is made to be multi-version, in fact I announce with great joy that the plugin is available for both PocketMine-MP 5 and PocketMine-MP 4!
Expand Down Expand Up @@ -59,22 +61,51 @@ Here a list of all commands that you can use:
| summon | SHOP NAME | Summon a Shopkeeper entity (as a Villager) for your Shop |
| rename | SHOP NAME and NEW NAME | [NOT AVAILABLE] Rename a current shop |
| list | none | Show all of your shops |
| history | SHOP NAME and PAGE | Show the trade history for the shopkeeper |

## Shopkeepers Skin System (SSS)
Yes, the v1.0 brought an epic function: now you can set a skin of a Shopkeeper.<br>
Unfortunately players can't add a skin of a Shopkeeper for multiple reasons:
- Memory
- Memory
- Memory
- Hmm, Memory?

Anyways, to avoid abuse of this system we have made this feature usable only by the server administrator.

### How to add a skin of a Shopkeeper
You should have seen something new in the `Shopkeepers` folder, the `skins` folder, and that is where all the skins should be put.
> **Warning**<br>
> Skins MUST BE in a `.png` file!
The file name should be composed as follows: `<PLAYER NAME>_<SHOP NAME>.png`, for example `FoxWorn3365_Fox.png` is valid and will be used by the plugin.
### I don't want to select skins
Well, if no skin is provided the classic villager is spawned. yeee

## F.A.Q.
### How to create an Admin shop
There is not really an Admin shop but you can activate this function by using the command `/sk info <SHOP NAME>` and then clicking on the Blaze Powder and then clicking on the red wool block that has "Admin shop" as its name

### How to see a Shopkeeper's inventory
There are two ways:
- Use the command `/sk info <SHOP NAME>` and then click on the chest at the center of the GUI
- Click on the Shopkeeper (Villager) entity
- Use the command `/sk info <SHOP NAME>` and then click on the chest!
- Click on the Shopkeeper (Villager) entity and then click on the chest!

### I want to access to the Shopkeeper's trade page but if i click the entity i access the inventory!
Easy: shift and click on the Shopkeeper

### How to despawn a Shopkeeper
More easy: just hit it, it will die in only one hit!

### I have [ClearLag](https://poggit.pmmp.io/p/ClearLag/2.1.0) and it removes the Shopkeepers entites!
Edit the config of ClearLag changing to `false` [this option](https://github.com/tobiaskirchmaier/ClearLag/blob/03e2a03a5f8868216dfc89eb78f51523ff228d6b/resources/config.yml#L84C5-L84C24).

### How can I change the skin of a Shopkeeper
We actually support a Skin System, please read up.

### OMG I CAN'T ACCESS TO THE INVENTORYM uyigqwieduwefibef
If the Shopkeeper is an Admin Shop it does not have an inventory!

## Bug reporting
Reporting bugs ~~to developers~~ to the developer😢 is very important to ensure the stability of the plugin, so in order to better track and manage all reports it is **incredibly necessary** that they are reported via [GitHub Issues](https://github.com/FoxWorn3365/Shopkeepers/issues).<br>
Here is what to include in the reporting to make it perfect:
Expand All @@ -87,7 +118,7 @@ Here is what to include in the reporting to make it perfect:
4. (OPTIONAL) The plugin download source
> Knowing where you downloaded the plugin from might help, always better to know some information
5. (OPTIONAL) The `Shopkeepers.phar`
> "Last wade," in case we can analyze the source
> "Last wade", in case we can analyze the source
## Contribution guide
Any contribution is greatly appreciated because you help me to lighten my workload, so here are some small guidelines to follow when you want to contribute:
Expand Down Expand Up @@ -200,13 +231,16 @@ Now, let's see the object:
```json
{
"author":"<PlayerNAME>",
"enabled":true,
"admin":false,
"title":"<ShopNAME>",
"namevisible":false,
"history":base64EncodedHistoryOfTransactions,
"inventory":[],
"items":[
{
"buy":nbtSerializedItem,
"buy2":?nbtSerializedItem,
"sell":nbtSerializedItem
}
]
Expand All @@ -215,9 +249,11 @@ Now, let's see the object:
| Name | Type | Description |
| --- | --- | --- |
| author | string | The username of the shop author |
| enabled | bool | Is the shop enabled? This option can be changed by the player in the menu config |
| admin | bool | If the shop is an Admin shop, so you don't have to put items in the inventory and you won't earn anything |
| title | string | The real name of the shop |
| namevisible | bool | Should the shop name be visible when summoned? |
| history | string | A base64 encoded string with all the transactions |
| inventory | array | The inventory of the shop |
| items | array | A list of all recepies (max 9) |

Expand All @@ -234,6 +270,8 @@ Also [this plugin](https://github.com/FrozenArea/TradeAPI) helped me!
- [x] Player shop
- [x] Shopkeeper's inventory updating when players buy
- [x] Shopkeeper deny a trade if the inventory is without the item
- [x] Double trade
- [x] Skin system
- [ ] Online shopkeeper editor
- [ ] Online shopkeeper shop (yes, you will be able to make shopping from your phone on the subway!)

Expand Down
94 changes: 0 additions & 94 deletions ShopInventory.md

This file was deleted.

Binary file removed plugin-banner-white.png
Binary file not shown.
Binary file removed plugin-banner.png
Binary file not shown.
10 changes: 8 additions & 2 deletions plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Shopkeepers
version: 0.9.1
version: 1.0.0
api: 5.0.0

main: FoxWorn3365\Shopkeepers\Core
Expand All @@ -10,7 +10,7 @@ description: Add shopkeepers to your PocketMine server!
commands:
shopkeepers:
description: The main shopkeepers command
usage: "/shopkeepers [list|create|summon|rename|edit|info] <NAME>"
usage: "/shopkeepers [list|create|summon|rename|edit|info|history] <NAME>"
aliases:
- sk
- shopk
Expand Down Expand Up @@ -43,6 +43,12 @@ permissions:
shopkeepers.shop.namevisible:
description: "Allow users to decide if the shopkepeer's name should be visible or no"
default: true
shopkeepers.shop.history:
description: "Allow users to view the trade history of his Shopkeepers"
default: true
shopkeepers.shop.enableDisable:
description: "Allow users to enable and disable their own Shopkeepers from the menu"
default: true
shopkeepers.shop.admin:
description: "Allows users to decide if the shopkeepers should be admin or none"
default: op
Expand Down
Loading

0 comments on commit b82a44e

Please sign in to comment.