[OLD] VillagerShops - Set up Mobs of any type as admin shop. Shops will use a Inventory-Menu to buy/sell items

ah, ok afaik sponge for Minecraft 1.10 is using sponge API version 5, Minecraft 1.11 is API 6 (receiving updates) and API 7 (actively developed) is for Minecraft 1.12.

I wrote this plugin for API 7 where they renamed the function to get the item type. I should be able to fix that for older APIs, but I’ll work on integrating LangSwitch first, might be done somewhere around sunday.

And thanks for the report :slight_smile:

1 Like

You’re welcome and good luck :smiley:

Also, Could you create a discord to keep updated with updates and maybe have a support channel and stuff?

i have a discord, it’s linked on my profile (hover/click my avatar)

Release Version 1.1

OK, so with a bit of playing around i got SpongeAPI 5 to not throw errors at me while testing VillagerShops, but trading items does not work for some reason - I can’t look further into. It seems to runs fine on the SpongeAPI 6.1 stable branch tho. Please Note, that the latest version of VillagerShops requires you to install LangSwitch as well

1 Like

Nice work ! @DosMike where do you hide the API 6 stable branch ? I cannot find 1.11 release on your repo.

there is no API6 branch. I wrote it for API7 with LangSwitch I added a few wrappers that are able to fall back to API6 methods, quickly ran it on a 1.11.2 spongevanilla and I was able to use it without problems. If you encounter problems on API6 you can open an issue on the git

May I ask how did you manage to run it ?
I just tried with a fresh local spongevanilla-1.11.2-6.1.0-BETA-17 server with no other mods than VillagerShop and the only trace I got from it is the following :

[11:48:33] [main/INFO] [mixin]: Compatibility level set to JAVA_8
[11:48:33] [main/DEBUG] [Sponge]: Searching for plugins...
[11:48:33] [main/INFO] [Sponge]: Searching for plugins...
[11:48:33] [main/TRACE] [Sponge]: Scanning mods\VillagerShops.jar for plugins
[11:48:33] [main/INFO] [Sponge]: 0 plugin(s) found
[11:48:33] [main/INFO] [Sponge]: Initialization finished. Starting Minecraft server...

I guess you are missing LangSwitch, make sure you downloaded the language files from VillagerShops as well

1 Like

Indeed, I missed the lang file but I did install LangSwitch, it’s big enough for not seeing it :joy:

I tried to rename the file en_US.lang as well as en.lang but nothing happens, the plugin still doesn’t show up.

Here are some pictures :

Where is the wrong part ?

It’s better to keep at least one language file without country tag as LangSwitch will use that as fallback, so en_UK would use the same file as en_US for example.

As to what’s wrong: I don’t know - seems there’s something wrong with your server setup, my server runs just fine - are you sure you confirmed the eula?

(Also you’ll need an economy plugin if you want to be able to buy stuff)

Well, I have the exact same thing :x

If I put an other plugin (like EconomyLite) in my mods folder then the server loads it.

Do you confirm that I have to download these files :
https://github.com/DosMike/VillagerShops/blob/master/release/mods/VillagerShops.jar https://github.com/DosMike/LangSwitch/blob/master/LangSwitch.jar

Are these the ones you use too ?

The files are the correct ones. If your screenshot is from your server ‘loading’ EconomyLite, then no, it sais 0 plugins loaded and is not the same. I might play around a bit more tomorrow

Nope, the screenshot is only for vshop + langswitch, I did an other test with economylite to check if sponge was loading plugins.

I am waiting for your answer tomorrow :slight_smile:

I downloaded spongevanilla 6.1-beta-17 again, dropped the 2 mods in and it ran without problems…
I literally did nothing else - I’m afraid I can’t help you as I can’t reproduce your problem :thinking:

The only thing I could suggest would be to not run the server on your C:-Drive as that tends to cause problems…

1 Like

Here I am again :stuck_out_tongue:

The problem was the file from github, I didn’t download it the right way. So I used the download button and it works muuuuuch better.

By the way, why don’t you use the release feature ?

Finally I can try it !


Edit : I love it :heart:

With the text conf, that’s incredibly easy to interact with your plugin. I might have a few requests :

• Implement /vshop reload command which would reload the config file. At least reload config when using /sponge plugins reload

• Add an id to each NPC and a /vshop reload <uniqueID>command

• Add a --at X Y Z optionnal flag in /vshop create command

• Improve messages to allow accents and colors

• Use the config/vshop folder for vshop.conf

• Add an “Available” line in item label e.g. :

<Item>
Buy for XX$
Stock : XX
<Item>
Sell for XX$
Limit : XX / <limit>

• Add a selling limit to avoid people filling a shop. vshop limit XX

• Include shop type in confirmation message. Created a new player/admin shop called <name>

• When manually modifying location of an NPC (and reboot), the new location has the right NPC but the old location has a lambda NPC.

What about lag test with several shops, did it run smoothly ? Any benchs ?

Do you plan to make an API ?

Could you explain what are UnsafeDamage and UnsafeData in config file ?

I will dig deeper to use your plugin at its full potentiel :slight_smile:

Thabk you for the great feedback. I’m still in Ireland so I can’t work on it right now, but I’ll answer as best as I can.

1st off I don’t know how to use the release feature xD
2nd the vshop.conf config was never ment to be fiddled with, and I’d actually prefer it to be a binary file…

I think /vshop reload is a thing already

Shops have a shop id, it’s just hidden and unused, and I don’t really see a point in reloading single shops.

Would an --at flag real be useful?

Lang files do support colors afaik, use the paragraph sign (§) and common format codes.

ok, I’ll move the config :slight_smile:

I’ll look into the limiters…

Confirmation messages shouldn’t be a problem

I do not have any benches, but feel free to do one and post the results. Would appreciate it.

What would you use the API for? Sorry but I really don’t see any way that could be useful

The unsafe data stuff is the damage/meta value for items from the old item id / type code times, if I’m not mistaken.

Might be able to take a look at everything next week or something…

You’re welcome, I try to notice every lacking features to make it better. Or perfect for my server for some points :angel:

My goal is to make a webpanel for players in order to avoid using to much commands but I know that most of my wishes won’t be used by others.

I grouped Q&A together for better understanding and maybe for future people reading the topic. I also added some answers :

My bad, I didn’t see /vshop reload :blush:

I wanted to be able to move NPC or chest because it’s really not convenient to have it directly under a block. As an example, one can not make the perfect aesthetic shop because he has to make an underground warehouse with stairs to be able to open the chest.
So I modified the config to move npc and see if I could use an external json decoder to modify the file and reload it. But I didn’t want to reload the whole thing in case of a player buying or modifying a shop so the idea came “reload only one npc” and voila.

cf last answer, having shop id in the config would be useful.

Considering a panel with npc type choice and taking player (or specific) location for reference, yes it would be useful. I must admit that it is part of “my perfect plugin features”.

tbh honnest, I didn’t try color codes because I didn’t see any formatting in the lang file. However, I tried with accents and UTF8 (no bom) encoding but the result was an awful symbol ingame.

Great, my OCD thanks you :joy:

Great again !

Easy money :dollar:

No answer, related to the “not meant to be fiddled” I suppose.

! First floor of my market can host 90 shops but I would like to allow people to put many NPCs. However, my serveur is not yet full (nor open) and I will try to run the server with several shops, lazy json generation inside.
Do you plan to include a database storing ? Could you add a permission to limite the number of npc per player ?

Still in the “perfect plugin features”, nevermind if you don’t plan to do it.

Well, I changed the UnsafeData for an egg and it modified the data. So unsafe might be safe in fact ? I did it on purpose to read config file externally decode json and modify it then reload the plugin.

Enjoy your irish trip :smiley:

My goal is to make a webpanel for players in order to avoid using to much commands but I know that most of my wishes won’t be used by others.
The webpanel thing sounds interesting, I once thought about parsing html into book menus, with links like <a href="/warp mall" target="console">Warp to mall</a> to link commands... might get some interesting results, I'll start on that if you're interested (but be aware that it wouldn't be able to display any website, it would have to follow some specific rules) :slight_smile:
I wanted to be able to move NPC or chest [...]
You should be able to change the container location in the config like this: make a playershop, put a chest at the new container location, save, edit the container location in the config, reload. I might add a command for players to move their container location to simplify things tho.
Considering a panel with npc type choice and taking player (or specific) location for reference, yes it would be useful. I must admit that it is part of “my perfect plugin features”.
Well I guess why not then...
However, I tried with accents and UTF8 (no bom) encoding but the result was an awful symbol ingame.
Could you send me the lang file? I might have to fix something up on the LangSwitch side if that's the case.
When manually modifying location of an NPC (and reboot), the new location has the right NPC but the old location has a lambda NPC.
No answer, related to the “not meant to be fiddled” I suppose.
That's correct, shops are not ment to be moved at all, as the position is still a bit part of identifying the shop. This saves some trouble with UUIDs when the NPC dies or otherwise get's lost - I can just check the location again.
However, my serveur is not yet full (nor open)
May I take a look at your server? :smiley:
Could you add a permission to limite the number of npc per player ?
Permissions suck to limit an amount. The only way I could think about this wouls be extremely dirty:
this is the Nth shop
with N <= C <= Some maximum
  does the player have a permission "vshops.playershops.amountC"?
    allow creation, otherwise don't
but I think I could add a proper config in addition to the shop storage, where you can define permissions that allow certain maximums. like this:
playershop.limits={
  "server.rankpermission.member"=1,
  "server.rankpermission.vip"=5
}
What would you use the API for? Sorry but I really don’t see any way that could be useful
Still in the “perfect plugin features”, nevermind if you don’t plan to do it.
Technically you can load any plugin and try to access public methods (and more if you know how to use reflection). If you want/need to things, I'd be best to ask me for implementing specific thing if you can't figure a way using existing means as I really don't know what a API could/should do with vshops
So unsafe might be safe in fact ?
Yes and no. UnsaveDamage is used as damage for weapons and as data value for items like coloured wool, effect data for Potions and similar. Afaik this is a left over from times without NBT, where every item really only had it's id, and the data value (meta), where weapons had no damage yet and is currently pretty much a magic number and I think I read that some future release of Minecraft will get rid of those, and use enum values instead.
1 Like

To limit an amount via permission, use options - it’s the same method that’s used for things like a player’s home limit. I haven’t worked with API 7 yet, but in API 5/6 it’s simply player.getOption(String key).