Admin shops with (refilling) stock
blablubbabcDEV opened this issue ยท 2 comments
Migrated from: https://dev.bukkit.org/projects/shopkeepers/issues/402
Originally posted by blablubbabc (May 1, 2016):
Admin shopkeepers with a certain stock which periodically and automatically refills.
Possible idea:
- Chest option in admin shop editor that opens a chest interface that represents the 'refill stock'. Players can add items there. These items would need to be saved in the save file.
- Another chest option that displays the current stock. Maybe also be editable, and is also saved in the shopkeeper.
- Option that asks for a refill rate, maybe similar to current renaming via chat: Player specifies the refill duration in seconds, minutes, or days (eg. "1d 5m 30s").
- The shopkeeper would have to remember the last time it refilled (wall clock time).
- A timer would periodically check if its time for a refill. If it is, the stock is repalced by the 'refill stock'.
Other considerations:
- This would require storing lots of items for the shopkeeper, both the current stock and the refill stock. Every change to these would require a new save of all shopkeeper data. An alternative would be to store the current stock inside a chest in the Minecraft world and link the admin shop to that chest. Only admins would have access to that chest (similar to the chest protection of player shops).
However, the 'refill stock' would still need to be specified and stored somehow (linking two different chests for this purpose seems confusing to me). - To reduce the number of editor options, the stock specific options (refill stock, current stock, refill rate) could be part of a separate interface that opens.
- There could also be an option to trigger an immediate restock from within the editor.
- Option to view the remaining time until the next refill.
- There could be a command to restock a specific, or all admin shops.
Alternative:
- Another aternative could be to not specify an item-based stock, but trading limits (total or per trade) that periodically reset.
- One can already simply use player shops and adjust the items inside the chest to reduce or restock shops. This ticket is specifically about the automation of refilling the stock of (non-player-managed) shops.
Ok, same idea but I was thinking on the player ones, to prevent a player from buying up stock from every vendor on a server for the purposes of stocking their own shop at higher prices. The UI is nice and simple, hard to think of many ways to incorporate some limits. If another row can be added, maybe the user could put the same item there and increment/decrement same way as price and that could represent daily limits? cant think of a way to do anything that isnt just a daily limit tho. Probably have a configuration option for server op to determine if its applied to MC day, IRL day, or some other value. I probably have a limited view of the plugin since I am a player, can the Prev/Next nav be moved down on same row as name/delete to get another row