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 events for parkour reset commands #322

Merged
merged 3 commits into from
May 20, 2022
Merged

add events for parkour reset commands #322

merged 3 commits into from
May 20, 2022

Conversation

steve4744
Copy link
Contributor

No description provided.

@steve4744
Copy link
Contributor Author

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

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.

Copy link
Contributor Author

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

Choose a reason for hiding this comment

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

Likewise here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

...and here.

@A5H73Y A5H73Y merged commit a8d5f74 into A5H73Y:7.0 May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants