-
Notifications
You must be signed in to change notification settings - Fork 34
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 events for parkour reset commands #322
Conversation
Add a Parkour event for resetting a player, course and leader board. |
@@ -1093,6 +1095,7 @@ public void resetPlayer(CommandSender commandSender, String targetPlayerId) { | |||
resetPlayer(targetPlayer); | |||
TranslationUtils.sendValueTranslation("Parkour.Reset", targetPlayerId, commandSender); | |||
PluginUtils.logToFile(targetPlayerId + " player was reset by " + commandSender.getName()); | |||
Bukkit.getServer().getPluginManager().callEvent(new ParkourResetPlayerEvent((Player)targetPlayer, null)); |
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.
Instead of casting this as Player, which could potentially cause an issue.
We could instead use targetPlayer.getPlayer()
which I believe should be a nullable field.
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.
That's fine, and is now updated.
@@ -288,6 +292,7 @@ public void resetPlayerCourseLeaderboards(CommandSender commandSender, String ta | |||
TranslationUtils.sendValueTranslation("Parkour.Reset", targetPlayerId + "'s " | |||
+ courseName + " Leaderboards", commandSender); | |||
PluginUtils.logToFile(targetPlayerId + "'s " + courseName + " leaderboards were reset by " + commandSender.getName()); | |||
Bukkit.getServer().getPluginManager().callEvent(new ParkourResetLeaderboardEvent((Player) targetPlayer, courseName)); |
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.
Likewise here.
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.
...and here.
No description provided.