[REQ] ADD support for the "dtlTraders" plugin
WoAnerges opened this issue ยท 14 comments
please add support for the "dtlTraders" plugin because in the trading menu map names show up as MAP#01, MAP#02 and so on, instead of the given names.
Thank you!
Redirected from:
-> http://piratepad.net/dtlTraders
-> Request #2
Can you clarify please exactly what sort of support you want added here? I'm not familiar with dtlTraders; is there some part of the dtlTraders API you'd like me to hook into? Right now I'm just using the regular Bukkit API to set the item name & lore via the ItemMeta system - see https://github.com/desht/ScrollingMenuSign/blob/master/src/main/java/me/desht/scrollingmenusign/views/SMSMapView.java#L315
Sorry but I really don't understand what you're asking for here. I don't rename map items at load time; they're renamed when a player creates a new map view with a command. And I'm only using the Bukkit ItemMeta API, as I said before; nothing unusual going on there.
If you have a specific request for a change in SMS, please state it clearly. Otherwise I'll just have to close this issue.
The problem lays in the way when you do it, because when I'm right you are doing this on plugin load, and applying some additional data to the map. As because I need to store the data in a string, any custom Data set to an item (that is not bukkit related) is going to vanish and wont get back.
I've added some API how to load/save any data/data reference from custom/vanilla items. I dunno really how you are applying/storing your data, but I think it's NBT related (or other system).
I can explain anything, because If this API works how it should it would be an achievement for me :D
P.S. I'm watching this request, it's really interesting for me :D And I can maybe try to test the API :P Any support will be provided from my side :)
I use this plugin "dtltraders" and it is a shop plugin. I try to sell some SMS maps, but unfortunatelly their names (menu titles) don't show up in the dtltraders shop inventory. dtltraders is a plugin based on citizens NPCs where you click on an NPC and inventory shows up where you can click-n-buy maps. I would love to see SMS supporting this plugin because so far, in dtltraders shop inventory all the maps made by SMS instead of their menu titles show the maps' ids, like if they were just regular maps.
I hope this explains the issue #4
Sounds very much like an issue with dltTraders, to be honest. The menu title is available; it's just a matter of checking if the map item has a displayName set (item.getItemMeta().getDisplayName()). If there's something that you think I need to add to SMS, then - again - please say what it is.
Sorry checked regular maps and everything is fine :D and any names item just works as it should I will investigate a bit :)
It checks for the name, saves it, but it does not find it I dunno just in the store view. After buying everything works fine.
I have found the problem why it was not showing the names of the maps. For whatever reason the set maps were reset. After restoring the configuration of SMS menu, it all works now. I still don't understand however why would maps get reset.
Now, when I recreated the configuration, instead of "mapId: -1" in the config it shows "mapId: 369". It was storing mapId: -1 for all my maps instead of the correct ids. it probably uses id -1 if something goes wrong..maybe it is after I tried to load the server with the wrong user and the plugin couldn't access the specified maps so it probably set them to -1 in config in order not to blow up :D
OK, I'm really not sure what the problem is here or where it lies. I've had a look at dtlTraders, but I can't figure out how to set up a trader NPC (no offence, but I can't understand the dtlTraders documentation at all). If you can provide me with instructions on how to get a basic trader up and running (I've got as far as /trader create <name>
) and how to give him some stock to trade, I can do some testing and see if SMS map items are being shown properly.
desht, it was not the dtltraders issue. I have found that SMS menu was storing wrong map ids in plugins/ScrollingMenuSign/data/views. For some reason, all map ids were switched from positive value to "-1":
http://pastebin.com/iPQXWAh0
This is why map names were not showing up correctly.
The only way that could happen is if the map view's internal Bukkit MapView object is null - in that case, SMS will save a map ID of -1. The only way that can happen is if the call to Bukkit.getServer().getMap(id)
fails when map data is being restored - which could possibly happen if you've migrated your map view files in plugins/ScrollingMenuSign/data/views
to a new server, i.e. one which doesn't have the corresponding map_X.dat
files in <server-dir>/world/data
.
In that case, you should also see messages like "No such map view for map ID " from ScrollingMenuSign in your server log - can you check your past logs for that please?
I can add some code to the next SMS release to create a new map view object if the saved map ID can't be found on the server (and log a warning to the server.log that the SMS view's map ID has been changed). That probably makes more sense than defaulting to an invalid -1 ID.
Then you must have somehow lost the map_X.dat
files in your world/data
directory. That's the only way a map view could end up with an ID of -1.