-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add greeting for new players through /tutorial #88
Conversation
Btw the code is kinda jank but it works, so if anyone has suggestions of what to edit, I can definitely try to fix it. |
@@ -68,7 +68,11 @@ public void onPlayerJoin(final PlayerJoinEvent event) { | |||
event.getPlayer().resetTitle(); | |||
event.setJoinMessage(ChatColor.YELLOW | |||
+ ChatColor.stripColor(event.getPlayer().getDisplayName()) + " joined the game"); | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you fix the indentation here?
src/main/java/com/hackclub/hccore/listeners/PlayerListener.java
Outdated
Show resolved
Hide resolved
import org.bukkit.entity.Player; | ||
|
||
public class TutorialCommand implements CommandExecutor { | ||
private static final String[] message = {ChatColor.RED + "Greetings! Welcome to the Hack Club vanilla Minecraft server!", "You can use /nick to set your nick name and /color to set your chat and name colors", ChatColor.RED + "Rules:\n", "Be nice.", "No griefing.", "Don't build within 1000 blocks of spawn.", "If you want to contribute to plugin development head on over to the GitHub: " + ChatColor.RED + "https://github.com/hackclub/HCCore/. ", "Type /tutorial to see this at any time."}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use the Java code linter? It'll automatically split it into multiple lines.
Player player = (Player) sender; | ||
for (String i : TutorialCommand.message) { | ||
sender.sendMessage(ChatColor.YELLOW + "" + ChatColor.BOLD + i); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
src/main/java/com/hackclub/hccore/commands/TutorialCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/com/hackclub/hccore/commands/TutorialCommand.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
if (event.getPlayer().hasPlayedBefore() == false) { | ||
event.getPlayer().performCommand("tutorial"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should make a function called startTutorialFlow
that takes a player as the parameter. This feels a little hacky lol.
src/main/java/com/hackclub/hccore/commands/TutorialCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/com/hackclub/hccore/commands/TutorialCommand.java
Outdated
Show resolved
Hide resolved
import org.bukkit.entity.Player; | ||
|
||
public class TutorialCommand implements CommandExecutor { | ||
private static final String[] message = {ChatColor.RED + "Greetings! Welcome to the Hack Club vanilla Minecraft server!", "You can use /nick to set your nick name and /color to set your chat and name colors", ChatColor.RED + "Rules:\n", "Be nice.", "No griefing.", "Don't build within 1000 blocks of spawn.", "If you want to contribute to plugin development head on over to the GitHub: " + ChatColor.RED + "https://github.com/hackclub/HCCore/. ", "Type /tutorial to see this at any time."}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest that you include the "greeting" part in a new player event so "greeting" does not message when you run the command again.
@@ -32,3 +32,7 @@ commands: | |||
tableflip: | |||
description: Appends a tableflip to your message | |||
usage: /tableflip [message] | |||
tutorial: | |||
description: Greets new users to the server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix description. the command itself does not greet new users.
I suggest that you include the "greeting" part in a new player event so "greeting" does not message when you run the command again.
Honestly, I'm not sure text is the best way to introduce the rules. I think a lot of players will ignore or skim over it, especially when joining. I've seen a few servers do a floating item frame walkway that introduces the rules at their spawn, which I quite like: If we're building a new spawn area (which @eankeen & I have talked about), perhaps we could do something similar to the above in that area. Then, maybe this command could become |
yeah not just having raw text would look much nicer |
Omg I totally forgot about this PR! I do like the item frame idea a lot
more though
…On Mon, Nov 9, 2020 at 9:03 PM Edwin Kofler ***@***.***> wrote:
yeah not just having raw text would look much nicer
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#88 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHJQZCO26DL33WEABQD22STSPCUOXANCNFSM4MWSU2IQ>
.
|
src/main/java/com/hackclub/hccore/commands/TutorialCommand.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Alex Park <[email protected]>
I think this PR is GTG, just need to run linting rq |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just don't forget to mention the modded server, its important so put it in bold, thanks :) after that i'l merge
Correct me if I'm wrong but I already have it bolded |
why was this closed? |
old pr that would've needed a lot of time spent to make work with new code - but if you @Monoverde888 would like to try to get this pr in a working state feel free! |
If you run /tutorial you'll get this:
New players will also get that when they join.
Closes #86.