Skip to content
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

Closed
wants to merge 87 commits into from

Conversation

jasonappah
Copy link
Member

If you run /tutorial you'll get this:

tutorial

New players will also get that when they join.

Closes #86.

@jasonappah
Copy link
Member Author

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");
}

Copy link
Collaborator

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?

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."};
Copy link
Collaborator

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);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation

src/main/resources/plugin.yml Outdated Show resolved Hide resolved
}

if (event.getPlayer().hasPlayedBefore() == false) {
event.getPlayer().performCommand("tutorial");
Copy link
Collaborator

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.

@ifvictr ifvictr marked this pull request as draft May 1, 2020 19:43
@ifvictr ifvictr marked this pull request as ready for review May 1, 2020 19:43
@nice6599 nice6599 added the enhancement New feature or request label May 2, 2020
@nice6599 nice6599 self-requested a review May 2, 2020 22:04
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."};
Copy link
Collaborator

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
Copy link
Collaborator

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.

@ifvictr ifvictr changed the title Add Greeting for New Players Add greeting for new players through /tutorial May 3, 2020
@jasonappah jasonappah marked this pull request as draft May 4, 2020 02:58
@zanedb
Copy link
Member

zanedb commented Nov 9, 2020

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:

image

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 /info (so you don't have to go to spawn to see the rules). What do y'all think?

@hyperupcall
Copy link
Member

yeah not just having raw text would look much nicer

@jasonappah
Copy link
Member Author

jasonappah commented Nov 10, 2020 via email

@nice6599 nice6599 self-requested a review November 10, 2020 15:05
@jasonappah jasonappah marked this pull request as ready for review July 14, 2021 20:19
@jasonappah
Copy link
Member Author

I think this PR is GTG, just need to run linting rq

Copy link
Member

@alx-alexpark alx-alexpark left a 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

@jasonappah
Copy link
Member Author

Correct me if I'm wrong but I already have it bolded

@Monoverde888
Copy link
Member

why was this closed?

@polypixeldev
Copy link
Collaborator

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Greeting for New Players