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

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).

Ah thanks, good to knowā€¦ not a fan of that yet, but Iā€™ll take a look :slight_smile:

Ok, the docs are not very descriptive regarding to optionsā€¦ to the option key is pretty much the same as the permission node up until the last dot and the value is everything after that?
So the ā€œpermissionā€ vshop.playershop.limit.10 would result in the option vshop.playershop.limit with value 10?

Sorry for the late reply !

Having the --at and visible ids are my main requirements and I am glad that you plan to implement them.

Regarding accents, I just tried to add Ć© and ĆØ but they didnā€™t display nicely ingame. Maybe it was because of my windows test server, I will do further tests on my linux one.

Canā€™t wait for the next updates :smiley:

Release Version 1.2

Everything Keuterio wanted (I hope I didnā€™t miss anything :wink: )

1 Like

options are single variables , not permission node strings, and depends on the permissions plugin being used as to how to represent them, but youā€™ll always find ā€œprefixā€ and ā€œsuffixā€ as core option variables in whichever implimentation.

Thank you for clarifying that

Release Version 1.3

Added skin support for llamas, rabbits and parrots
Silenced shop npcs
Changed the dash(-) in /vshop add to a tilde(~) (e.g. /vshop add ~ 5)

Great options, I couldnā€™t bare NPC sounds :joy:

Iā€™m getting this error using v1.2 and v1.3 ( this is from v1.2 ).

Any ideas ?

reading the error: ... java.lang.NoClassDefFoundError: Lde/dosmike/spong e/languageservice/API/PluginTranslation;

Iā€™d say you did not install LangSwitch. Looking at the mods forge loaded Iā€™d say you did not install LangSwitch.

The first line in this topic sais this plugin requires LangSwitch.

Please tell me what else to do so people will read that. This is not meant to sound rude, I really donā€™t know what else to do for people to read that.

Haha, I really didnā€™t see anything, Iā€™m stupidā€¦
Now works like a charm, thanks !

Edit: @DosMike Was it intentional that I could kill shopkeepers? They spawn again after kill. It would be better if they were untouchable.

it was easier to just not to make them invincible since they respawn anyway. also in case they do happen to get disconnected from the plugin somehow you donā€™t have drop it into the void but can just kill them