Clean up some Bukkit code

This commit is contained in:
Alexander Söderberg 2020-09-07 12:12:56 +02:00
parent 62abfa5e95
commit a8d3fa7c5e
No known key found for this signature in database
GPG key ID: C0207FF7EA146678
7 changed files with 82 additions and 6 deletions

View file

@ -35,7 +35,7 @@ import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
public class BukkitPluginRegistrationHandler implements CommandRegistrationHandler {
final class BukkitPluginRegistrationHandler implements CommandRegistrationHandler {
private final Map<CommandComponent<?, ?>, org.bukkit.command.Command> registeredCommands = new HashMap<>();
@ -71,8 +71,10 @@ public class BukkitPluginRegistrationHandler implements CommandRegistrationHandl
} else {
label = commandComponent.getName();
}
this.bukkitCommands.put(label, new BukkitCommand((CommandComponent<BukkitCommandSender, ?>) commandComponent,
this.bukkitCommandManager));
final BukkitCommand bukkitCommand = new BukkitCommand((CommandComponent<BukkitCommandSender, ?>) commandComponent,
this.bukkitCommandManager);
this.bukkitCommands.put(label, bukkitCommand);
this.registeredCommands.put(commandComponent, bukkitCommand);
return true;
}