refactor: fixup wrong file header, cleanup

dependabot/gradle/org.projectlombok-lombok-1.18.34
William 5 months ago
parent cffb5b0020
commit 79c7d4d304
No known key found for this signature in database

@ -19,26 +19,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
package net.william278.uniform.bukkit;/* package net.william278.uniform.bukkit;
* This file is part of Uniform, licensed under the GNU General Public License v3.0.
*
* Copyright (c) Tofaa2
* Copyright (c) William278 <will27528@gmail.com>
* Copyright (c) contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import net.kyori.adventure.platform.bukkit.BukkitAudiences; import net.kyori.adventure.platform.bukkit.BukkitAudiences;
import net.william278.uniform.Command; import net.william278.uniform.Command;
@ -57,6 +38,7 @@ import java.util.Locale;
* *
* @since 1.0 * @since 1.0
*/ */
@SuppressWarnings("unused")
public final class BukkitUniform implements Uniform<CommandSender, BukkitCommand> { public final class BukkitUniform implements Uniform<CommandSender, BukkitCommand> {
private static BukkitUniform INSTANCE; private static BukkitUniform INSTANCE;

@ -45,12 +45,12 @@ public final class PaperUniform {
private PaperUniform(@NotNull JavaPlugin plugin) { private PaperUniform(@NotNull JavaPlugin plugin) {
if (isUseModernApi()) { if (isUseModernApi()) {
PaperCommand.register(plugin, commands); PaperCommand.register(plugin, commands);
} else { return;
}
plugin.getServer().getPluginManager().registerEvents( plugin.getServer().getPluginManager().registerEvents(
new LegacyPaperCommand.Registrar(plugin, legacyCommands), plugin new LegacyPaperCommand.Registrar(plugin, legacyCommands), plugin
); );
} }
}
private static boolean isUseModernApi() { private static boolean isUseModernApi() {
try { try {
@ -102,9 +102,9 @@ public final class PaperUniform {
public void register(@NotNull Command... commands) { public void register(@NotNull Command... commands) {
if (isUseModernApi()) { if (isUseModernApi()) {
register(Arrays.stream(commands).map(PaperCommand::new).toArray(PaperCommand[]::new)); register(Arrays.stream(commands).map(PaperCommand::new).toArray(PaperCommand[]::new));
} else { return;
register(Arrays.stream(commands).map(LegacyPaperCommand::new).toArray(LegacyPaperCommand[]::new));
} }
register(Arrays.stream(commands).map(LegacyPaperCommand::new).toArray(LegacyPaperCommand[]::new));
} }
} }

Loading…
Cancel
Save