FastFelix771 / TownyWands

A highly customizable GUI plugin for Towny to make the life of Minecraft players a little bit easier.
http://dev.bukkit.org/bukkit-plugins/townywands/
GNU General Public License v3.0
4 stars 2 forks source link

command not recognised #9

Open Mrs-Feathers opened 6 years ago

Mrs-Feathers commented 6 years ago

doing a command like /mayor or /resgui opens up the menu like normal, which is nice. but when i have a command sign making the player do it, or command item.. or even using essentials' "sudo" command... it just tells the player the command isn't recognised. i need a way to make the player open the menu without typing the command.

i assume because of this issue the commands are being listened for by the plugin, and not actually initalized with bukkit.. is there any command like "/townywands open resgui" so i can use a "truely initalized command" with sudo so i stop getting the "unknown command" errors?

FastFelix771 commented 6 years ago

Hi,

this is actually the way the plugin should behave. The commands to open a GUI can be configured dynamically, thats why i cannot "simply" (i could, but with a lot of caveats) register these "commands" as real commands.

It listens on chat messages that starts with / instead, because every command, even invalid ones, triggers this.

The items and signs should already execute commands in a chat-like way to work in exactly this situation. I'll check the codebase and find out... it's been a while since someone asked about this plugin. ^^

"/townywands open resgui" Thats a good idea. I'll add this!

FastFelix771 commented 6 years ago

I checked the codebase and it actually executes the commands directly via Bukkit. Whoops.

I'll edit this accordingly to make it work. Thanks for pointing it out!

May i ask what things you try to accomplish with these GUIs? It sounds like a "/townyhelp" GUI that shows some Items opening to the other GUIs.

Mrs-Feathers commented 6 years ago

not exactly. i have craftbook, if you know it.. its a plugin where you can do a bunch of things, but what i was looking at is having an item.. and when holding the item and right clicking, it runs a command. so, i was thinking, you know, have that "command item" run the /resgui command... have a physical item open your townywands menus. yeah? most MC players are younger and i'm sure you know players are always asking what commands do what.. and then just complaining its too complex for them... i thought i'd make a kit with items they can hold and use to enter various menus and do stuff if they have an issue with the commands, they're all there by simply using a compass to get a warps menu i made.. or even having a clock be a "main menu" with all the sub menus under it, but still, i'd need to be able to force the user to use the command to open that menu from the other menu.

Mrs-Feathers commented 6 years ago

This is unrelated.. so i should probably put it elsewhere.. its more of a feature request. i didn't actually expect an answer from you, so kudos for that. so, i tried installing another plugin off dev.bukkit.org called minemenu. its neat. its no where near as nice as yours.. however there are two features it has that yours doesn't. 1. you can enter a chest inventory.. like a backpack... or ender chest. you can "award" users more than one inventory that can be accessed via the menu. 2. this is not something i'd personally use as i have another plugin for player markets, but you can "purchase" stuff via the menu.

the plugin feels worthwhile to check out if you're still working to improve your already wonderful menu plugin.

as a side note though, and idk if this is a bug or just me, but in your plugin, i wasn't able to click the first inventory space. as in, clicking inventory slot "0" wouldn't run the command for me. i had to move everything over by one and use that space for a "title" for the menu or something like that. but again, idk if thats just me or not.

FastFelix771 commented 6 years ago

Interesting. Which version of TownyWands and ProtocolLib are you using? I'll check this on the weekend and release a fix if possible.

Mrs-Feathers commented 6 years ago

Version 2.1.0 of Towny Wands and i’m not quite sure which version of protocol lib, however, using http://ci.dmulloy2.net/job/ProtocolLib/lastStableBuild/ http://ci.dmulloy2.net/job/ProtocolLib/lastStableBuild/ i’ll update to the latest jar and test again

On 2018年5月14日, at 17:14, Felix Drescher-Hackel notifications@github.com wrote:

Interesting. Which version of TownyWands and ProtocolLib are you using? I'll check this on the weekend and release a fix if possible.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/FastFelix771/TownyWands/issues/9#issuecomment-388965103, or mute the thread https://github.com/notifications/unsubscribe-auth/ABqmdtV4oVtGAD-X9bjQNsDtc5QY1bbxks5tyfOzgaJpZM4T6cDJ.

Mrs-Feathers commented 6 years ago

update: with the latest version of protocollib from that site there, it still doesn't work. sorry. its just the first slot. idk whats up with it.

FastFelix771 commented 6 years ago

I'll check this behavior with the latest dev version today. I just realised the codebase is already at v2.1.1 =)

FastFelix771 commented 6 years ago

@MothGirlMusic I've finally got time to fix these issues today. The command you wished is created and tested - works good so far. I have discovered that i already implemented something like that to prevent issues with plugins like mine.

/fakecmd This command can be used to force a player to chat / which triggers the GUI commands successfully. You'll have to configure it as an console-command to work!

But to make this some more flexible and compatible to the virtual signs, i still added /tws open for you.

I also found the source of this weird bug with the first inventory slot. It was a simple flaw in the plugin logic and is fixed now.

I also fixed an additional bug caused by the virtual signs, which caused commands to be executed asynchronously. Now it's wrapped in a scheduler that runs it on the main thread.

I'll post an Update on Spigot and BukkitDev in the next minutes and push the new file.

If you find any other bugs, feel free to report them. And please give some feedback if the new version fixes this issue, so i can close it. =)

Mrs-Feathers commented 6 years ago

awesome!!! :D and neat.. i honestly didn't know what /fakecmd actually did other than what i was using for "/sudo" and as you know doing /sudo with other plugins didn't work, so i honestly didn't think to try it.