[Discontinued] Server Shops v1.1.0 - Simple and lightweight server shops

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!

10 Likes

Does this plugin supports any Nbt data?

1 Like

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.

1 Like

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?

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.

1 Like

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

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

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.

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?

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

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

I just store the ItemStack itself.

1 Like

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

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

1 Like

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…

you should make a plugin for player shops using chests

2 Likes

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

error in 1.8.9 forge.

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

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

1 Like