Closed lokka30 closed 3 years ago
@lokka30 I would like to pick up this issue. Should this be handled in the TeleportSubcommand.java class or would it be better to create a separate subcommand class solely for this command? Also, should this be able to accept a Player as an argument? I think that would be a factor in whether or not this gets its own class.
@lokka30 I would like to pick up this issue. Should this be handled in the TeleportSubcommand.java class or would it be better to create a separate subcommand class solely for this command? Also, should this be able to accept a Player as an argument? I think that would be a factor in whether or not this gets its own class.
Hey, thank you so much for considering a contribution to the resource! :)
Now that I think of it, the way I want to implement this might not be a 'good first issue' - depends on what we do. I'll explain my thoughts, please let me know what you think about it, especially if it is too difficult for you. Additionally, please excuse me if I am getting the names of classes or methods wrong, I'm quite certain they are correct although I am typing this from memory.
Here's how I would handle it, feel free to let me know if you think there are better ways:
/pw spawn [player]
, of course [player]
being an optional argument.TeleportSubcommand
class. If we add aliases as separate classes, it could become messier. However, even with the player argument I think it is still better to do it in the same class.TeleportSubcommand
class, we need to separate the contents of the parseCommand
method into its own teleportToWorld(CommandSender sender, Player targetPlayer, World world)
method, where sender
is who teleported the player, targetPlayer
is who is being teleported (can be the sender of course) and world
is which world the targetPlayer
is being teleported to.spawn
into TeleportSubcommand
's parseCommand
method. In this method we should add a switch
statement that checks if args[0].toLowerCase(Locale.ROOT)
equals spawn
, if so run teleportToWorld(sender, targetPlayer, targetPlayer.getWorld())
./pw teleport <world> [player]
is more suitable anyways. Keen to hear your thought on this.)spawn
vs teleport
command, also need to add spawn
to the list of suggested commands in the PhantomWorldCommand
class.If you would prefer me pick up on this issue then no problem at all of course. If you have any ideas to improve what I have thought of then by all means release them into the comments below. 😃
And by the way, if you would prefer to work on a far simpler issue then #24 may be of interest, although it's more-so just repetitive manual stuff than getting cool things added. I can do #24 very quickly as soon as I finish my exams.
Lastly, the current code in the dev
branch (master
is for released versions' code only, when a version is released I simply merge the code from dev
into master
) is not finished, this is because I have not had the time to work on it due to examinations. It's unlikely I will be able to work on this plugin more than talking to the community about it e.g. here and for the few server owners out there that need a hand with a command or something. My exams will be finished in late November.
All the best, ~ lokka30
Thank you for the detailed response. Maybe I will take a look at #24 and try that issue first. I think I could implement this issue how you want it, so I'll come back and attempt it. I'll let you know if I have any problems. Thanks!
Issue status: see #30.
Suggested by Koh