Server Shops v1.1.0 - Simple and lightweight server shops


#1

Server Shops
Simple and lightweight server shops

Download (v1.1.0): https://github.com/Nentify/Server-Shops/releases/tag/v1.1.0
Source: https://github.com/Nentify/Server-Shops

Features

  • Buy items from players
  • Sell items to players
  • Supports items with metadata and NBT data

Planned Features

  • Multi-currency support

Usage

  1. Hold the item you wish to buy/sell
  2. Point at the sign you wish users to buy/sell to
  3. Use the command /buyshop <price> [quantity] or `/sellshop [quantity]
  • If you don’t specify a quantity, it will take the quantity from the stack you’re holding
  1. Players can now right click to buy or sell from the sign
  • It’s up to you what text goes on the sign or how you decorate it
  • This plugin does not enforce anything or put any text on your signs

Commands

  • /buyshop <price> [quantity]
  • Create a buy sign for the item you’re currently holding for the specified price
  • The quantity will be taken from the stack you’re holding if left blank
  • /sellshop <price> [quantity]
  • Create a sellsign for the item you’re currently holding for the specified price
  • The quantity will be taken from the stack you’re holding if left blank

Permissions

  • servershops.create.buy
  • Use the /buyshop command
  • servershops.create.sell
  • Use the /sellshop command

Changelog

v1.1.0

  • Support items with NBT data
  • Support doubles for price
  • Improve texts and formatting
  • Backported to Sponge API 4.1.0 for MC 1.8.9

v1.0.0

  • Initial release

Enjoy!


Sign Shop Plugin
Shop System
Item trader
#2

Does this plugin supports any Nbt data?


#3

No it doesn’t. It only supports item metadata/damage values which means it works for mod items that share the same item ID. It won’t support things like items in backpacks or energy storage for example.


#4

actually i think its possible to get all data like /entitydata command…
it gives something like this to a spawn egg Creeper
{Entity:{id:“Creeper”}}…
are there any commands to get entitydata in java like this?


#5

If I can figure out a simple way to do this then I’ll do an update, but for now it only supports item metadata.


#6

it would be really nice im trying to find too lets share if we can find a way :slight_smile:


#7

I’ve figured out a way, will release an update in a minute. :slight_smile:


#8

A couple things:

  • I’d recommend a double, rather than an integer, for the price. You never know what crazy economy system someone’ll have.
  • I’d also not recommend taking pre-existing Text, converting it to a plain String, and then concatenating it to another string in another Text.of(). For this very reason, Currencies have a .format() method. Heck, I wouldn’t recommend string concatenation in Text.of() anyway, since you can just as easily comma-separate the values.
  • It wouldn’t take much to add multiple currency support, and it’s much better than always using the default currency.
  • On the subject of adding to the data, you can make sure that there’s automatic versioning if your DataManipulatorBuilder also extends AbstractDataBuilder.
  • In your listener, you can use the ItemType directly in the Text, since it’s Translatable.

#9

I was thinking about this and will probably change this. I created this plugin with my server in mind first, so it’s tailored towards how I prefer to run things.

When I wrote this, I knew I was being lazy. :smiley: I will look into the format() method, seems like a good idea.

I’ll take a look at supporting multiple currencies. If it’s simple enough, it will be in the next version, no promises though.

I was wondering about this. While I’m unsure if anyone’s using my plugin yet, I don’t want to break peoples signs when I change the data.

Will take a look at this. If it returns the actual item then that is great!

Thanks for your feedback, will take it on board!

Edit: Do you have any references/more information for updating the content version safely/using AbstractDataBuilder?


#10

v1.1.0

  • Support items with NBT data
  • Support doubles for price
  • Improve texts and formatting

Download: https://github.com/Nentify/Server-Shops/releases/tag/v1.1.0


#11

how did u add support for Nbt? i couldnt understand…


#12

I just store the ItemStack itself.

https://github.com/Nentify/Server-Shops/blob/master/src/main/java/me/nentify/servershops/data/ServerShopData.java#L18


#13

then how do u store itemstack in a file?
they are stored in a file right?


#14

No, I use the data API. To store it in a file, you need to look at serialisers I think. I’d recommend joining the IRC channel #spongedev for help.

https://docs.spongepowered.org/master/en-GB/plugin/configuration/serialization.html


#15

Oh as far as i understand in simple
u get the itemstack in the item frame and send the same to the player in buying…


#16

you should make a plugin for player shops using chests


#17

I was thinking about doing this - It would probably be a separate plugin.


#18

error in 1.8.9 forge.


#19

Hi - This plugin was built on API 5. I will backport it to API 4 today for you.


#20

I have backported the plugin for MC 1.8.9. You can download it from the releases page now. Enjoy!