catageek / ByteCart

Minecraft plugin for bukkit to create a LAN/WAN rail network with routing algorithm
GNU General Public License v3.0
27 stars 9 forks source link

Make it possible to use /bcticket with command block #12

Closed githubnemo closed 11 years ago

githubnemo commented 11 years ago

Also fix bcticket in general as it didn't had any parameters or did something useful.

New syntax for bcticket:

/bcticket <destination>

or (for command blocks):

/bcticket <player> <destination>
catageek commented 11 years ago

Thanks a lot !

I think you should manage the 'train' option, like 'mego' does.

In fact I planned to remove bcticket as, as you said, it was not useful since 'mego' or 'sendto' did the job, but the support for command block was missing.

Maybe 'mego address [train]' should be an alias for 'bcticket player address [train]' and bcticket will contain all the code with train option support.

Another point is that "Usage" explanation is set in permissions.yml, so you just have to return false if args do not match and Usage will be displayed. No need to display error strings in this case.

githubnemo commented 11 years ago

I will probably do that in a few days.

githubnemo commented 11 years ago

The bcticket command now supports the train parameter and the usage is fetched from plugin.yml by returning false in the bcticket method.

I thought it would be a good idea to isolate the bcticket command in its own method.

The only thing missing now is the refactoring of mego and sendto.

catageek commented 11 years ago

Thank you !