Skip to content
This repository was archived by the owner on May 10, 2024. It is now read-only.

Conversation

@Paldiu
Copy link

@Paldiu Paldiu commented Apr 11, 2023

This covers quite a bit of ground, namely:

  • Removal of commands which are now obsolete due to better alternatives
  • Removal of legacy ranks in favor of permissible nodes
  • Changed displayable implementations to use LuckPerms Group data
  • Integrated master builders into an actual rank instead of a basic cosmetic title.
  • Added @intercept annotation for overriding commands that were already registered with the CommandMap before TFM could load in
  • Adjusted the loading of commands annotated with @intercept and @CommandDependency to be loaded in POSTWORLD, on the first actual game server tick.
  • Moved the RankManager#updateDisplay(Player) calls out of the following commands:
    • Command_op
    • Command_opall
    • Command_opme
    • Command_deop
    • Command_deopall
    • Command_mbconfig
    • Command_saconfig
  • Moved RankManager#updateDisplay(Player) into LuckPerms event subscriptions for NodeAddEvent and NodeRemoveEvent
  • Properly register the commands with the Bukkit command framework using PluginCommand#setExecutor() and PluginCommand#setTabCompleter()

Paldiu added 12 commits April 7, 2023 16:06
Moved command loading into a runnable that will execute on the first server tick. This way, we can ensure that all the plugins are loaded before we load our commands, so TFD4J and Shop can both have their respective commands loaded in.
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

LGTM, although there seem to be a few style violations.

return;
}

if (result == null) {
Copy link

Choose a reason for hiding this comment

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

Allman's code style

HierarchyProvider.ADMIN.getHierarchy()
.promoteUser(GroupProvider.getUser(player))
.whenComplete((result, ex) -> {
if (ex != null) {
Copy link

Choose a reason for hiding this comment

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

Allman's code style

FUtil.adminAction(sender.getName(), "Promoting " + player.getName() + " to the next rank", true);
HierarchyProvider.ADMIN.getHierarchy()
.promoteUser(GroupProvider.getUser(player))
.whenComplete((result, ex) -> {
Copy link

Choose a reason for hiding this comment

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

Allman's code style

{
msgNew("<red>Failed to promote <player> to the next rank.", player(player));
return;
} else {
Copy link

Choose a reason for hiding this comment

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

Allman's code style

});
}

private Map<String, Command> getFallbackCommands() {
Copy link

Choose a reason for hiding this comment

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

Allman's code style


private Map<String, Command> getFallbackCommands() {
final Map<String, Command> fallbackCommands = new HashMap<>();
for (final Map.Entry<String, Command> entry : Bukkit.getCommandMap().getKnownCommands().entrySet()) {
Copy link

Choose a reason for hiding this comment

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

Allman's code style

private Map<String, Command> getFallbackCommands() {
final Map<String, Command> fallbackCommands = new HashMap<>();
for (final Map.Entry<String, Command> entry : Bukkit.getCommandMap().getKnownCommands().entrySet()) {
if (!(entry.getValue() instanceof PluginIdentifiableCommand)) {
Copy link

Choose a reason for hiding this comment

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

Allman's code style

{
if (!manager.isLoaded(name) || !trackSet.contains(manager.getTrack(name)))
{
return manager.createAndLoadTrack(name).thenApplyAsync(a -> {
Copy link

Choose a reason for hiding this comment

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

Allman's code style

if (plugin.al.isAdmin(player) || data.isMasterBuilder() || FUtil.isDeveloper(player))
{
player.playerListName(Component.text(player.getName()).color(display.getColor()));
} else
Copy link

Choose a reason for hiding this comment

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

Allman's code style

Paldiu added 3 commits April 13, 2023 14:37
Build has a critical error where sql data is being interpreted incorrectly which is odd considering no sql changes were made.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants