-
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
Closed
Closed
Changes from all commits
Commits
Show all changes
87 commits
Select commit
Hold shift + click to select a range
47cd73c
Created TutorialCommand.java
jasonappah 282f4b2
Added /tutorial to plugins.yml
jasonappah 921b9e1
Added tutorial command to PlayerListener.java
jasonappah 00a8ab0
Finished /tutorial command
jasonappah 1f17838
Run /tutorial when new players join
jasonappah 3df48fb
remove extra space in plugin.yml
jasonappah b578fee
capitalized name of static array message
jasonappah c14b55d
Merge branch 'master' into master
nice6599 be30415
Get rid of unused variable player
jasonappah baa942f
Moved for loop into if else statement
jasonappah 9693fb7
Simplified L26
jasonappah 4003993
Removed extra spaces
jasonappah 1ca7f94
Merge branch 'master' of https://github.com/jasonappah/HCCore
jasonappah c387f45
Merge branch 'master' into master
jasonappah 0b84b59
Fix autocomplete for second parameter of /stats (#95)
nice6599 bcf7496
Exclude AFKed players from the sleep threshold (#92)
harbar20 82b3f62
Fix NPEs in SleepListener on player quit (#99)
ifvictr f08d5de
Disallow AFK players from sleeping (#98)
ifvictr 4d68c0a
Make /spawn message clearer (#100)
ifvictr 6c60beb
Upgrade dependencies to 1.16
ifvictr 3adbda6
Download 1.16 Spigot JAR on Travis build
ifvictr 3652094
Fix advancement message colors
ifvictr bf0a261
Use license's full name [skip ci]
ifvictr b41ad23
Added /upvote and /downvote (#103)
rfblock 86e8fc5
Change /downvote from aqua to blue (#105)
rfblock c82c5c4
Added Pigstep to Musicophile (#107)
rfblock 2ca45ed
Show usernames when hovering on player nickname in chat (#108)
rfblock 7617a31
migrate to gradle
hyperupcall 9b50e5e
fix: remove accidentally commited Justfile
hyperupcall 1301bf3
ci: remove maven
hyperupcall ee941b2
ci: fix travis
hyperupcall e08d6ce
ci: fix gradle scan
hyperupcall 1b84ebd
ci: travis don't daemonize
hyperupcall a976c3a
ci: remove gradle scan
hyperupcall 4d2a755
ci: fix java installation
hyperupcall 4e82785
ci: add maven central
hyperupcall d2b9764
Allow spaces in loc command
wei2gao 81e607e
Use built-in functions for string joining
wei2gao b8f2342
Delimit location names with underscores
wei2gao 2311e28
Replace argString with locationName
wei2gao 77c942c
Remove getArgAsString, it's not necessary
wei2gao 6bc3b93
Remove space
ifvictr beba7a9
Location sharing, first implementation attempt
wei2gao bb1d3b9
Bring up to date with master
wei2gao 4f03437
Location sharing (not well tested)
wei2gao c8ca4b2
Implement @ifvictr's suggestions
zanedb 898eb4d
docs: add documentation for setting up environment
hyperupcall fdbd9b7
Fix typos
ifvictr 0f61260
Make heading levels descend by one
ifvictr 8c6dbf2
Replace "l" with vertical bar in usage message
ifvictr 991419f
Update point-of-contact
zanedb ad0517e
fix: modify SETUP for Gradle
hyperupcall 59e7dd7
Download 1.16.4 server JAR on Travis builds
ifvictr 975b67f
Depend on 1.16.4
ifvictr 39e707b
fix: actually merge properly
hyperupcall a54de44
Update ping message for new joiners
faisalsayed10 0a3a163
Remove deploy section as that is broken because of the migration to t…
c7a1e5b
Added Discord integration
elinicksic 85d7f64
Update to 1.17
elinicksic 5128823
Fixed build.gradle to include JDA in the jar
elinicksic 0f8cc90
Update the travis for 1.17
elinicksic 8068b72
Added /tutorial to plugins.yml
jasonappah 8e78ea7
Added tutorial command to PlayerListener.java
jasonappah 17396c7
Created TutorialCommand.java
jasonappah a40c395
Added /tutorial to plugins.yml
jasonappah d0c0587
Added tutorial command to PlayerListener.java
jasonappah 91f5ead
Finished /tutorial command
jasonappah 50505cd
Run /tutorial when new players join
jasonappah 4d03fb3
capitalized name of static array message
jasonappah 3dfda39
Get rid of unused variable player
jasonappah 8aeb7de
Moved for loop into if else statement
jasonappah b334808
Simplified L26
jasonappah cca345b
Removed extra spaces
jasonappah b4de51e
Added /upvote and /downvote (#103)
rfblock 1dfd3e1
Allow spaces in loc command
wei2gao b463df5
Delimit location names with underscores
wei2gao 2379982
Replace argString with locationName
wei2gao 55b65b4
Remove getArgAsString, it's not necessary
wei2gao b5be2a1
Added Discord integration
elinicksic c642e80
Added /tutorial to plugins.yml
jasonappah 5c20e33
Added tutorial command to PlayerListener.java
jasonappah 5dff6a3
chore: undo accidental version change
jasonappah a427cf3
chore: merge
jasonappah db289c2
Update src/main/java/com/hackclub/hccore/commands/TutorialCommand.java
jasonappah 2889df8
chore: remove broken import
jasonappah 6bcde1e
feat+refactor: separate greeting/rules message
jasonappah 6a55070
style: lint and format
jasonappah File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 11 additions & 1 deletion
12
src/main/java/com/hackclub/hccore/commands/DiscordCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/com/hackclub/hccore/commands/TutorialCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.hackclub.hccore.commands; | ||
|
||
import com.hackclub.hccore.HCCorePlugin; | ||
import com.hackclub.hccore.utils.TutorialUtil; | ||
import org.bukkit.ChatColor; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
|
||
public class TutorialCommand implements CommandExecutor { | ||
|
||
private final HCCorePlugin plugin; | ||
|
||
public TutorialCommand(HCCorePlugin plugin) { | ||
this.plugin = plugin; | ||
} | ||
|
||
@Override | ||
public boolean onCommand(CommandSender sender, Command cmd, String alias, String[] args) { | ||
if (!(sender instanceof Player)) { | ||
sender.sendMessage(ChatColor.RED + "You must be a player to use this"); | ||
return true; | ||
} else { | ||
TutorialUtil.send((Player) sender, false); | ||
} | ||
|
||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.hackclub.hccore.utils; | ||
import org.bukkit.ChatColor; | ||
import org.bukkit.entity.Player; | ||
|
||
public class TutorialUtil { | ||
public static final String greeting = ChatColor.RED + "Greetings! Welcome to the Hack Club vanilla Minecraft server!"; | ||
|
||
public static final String[] tutorial = {"Use /nick to set your nick name and /color to set your chat and name colors", ChatColor.RED + "Rules:", "Be nice.", "No griefing or stealing", "No mods that give an unfair advantage", "Follow Hack Club CoC", "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 and /discord to join the Discord!" + ChatColor.BLUE + ChatColor.BOLD + "Also check out the modded server - IP: modded-mc.hackclub.com"}; | ||
|
||
public static void send(Player player, boolean withIntro) { | ||
if (withIntro) { | ||
player.sendMessage(ChatColor.YELLOW + ChatColor.BOLD.toString() + greeting); | ||
} | ||
for (String message : tutorial) { | ||
player.sendMessage(ChatColor.YELLOW + ChatColor.BOLD.toString() + message); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,3 +41,6 @@ commands: | |
discord: | ||
description: Gets the invite link to the Hackclub Minecraft Community Discord server | ||
usage: /discord | ||
tutorial: | ||
description: Greets new users to the server | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fix description. the command itself does not greet new users.
|
||
usage: /tutorial |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?