From 79c7d4d304ebe01ed8e15c1ec027ba6330111dad Mon Sep 17 00:00:00 2001 From: William Date: Sat, 15 Jun 2024 23:30:06 +0100 Subject: [PATCH] refactor: fixup wrong file header, cleanup --- .../uniform/bukkit/BukkitUniform.java | 22 ++----------------- .../uniform/paper/PaperUniform.java | 12 +++++----- 2 files changed, 8 insertions(+), 26 deletions(-) diff --git a/bukkit/src/main/java/net/william278/uniform/bukkit/BukkitUniform.java b/bukkit/src/main/java/net/william278/uniform/bukkit/BukkitUniform.java index 42ed0b4..4bd5eee 100644 --- a/bukkit/src/main/java/net/william278/uniform/bukkit/BukkitUniform.java +++ b/bukkit/src/main/java/net/william278/uniform/bukkit/BukkitUniform.java @@ -19,26 +19,7 @@ * along with this program. If not, see . */ -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 - * 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 . - */ +package net.william278.uniform.bukkit; import net.kyori.adventure.platform.bukkit.BukkitAudiences; import net.william278.uniform.Command; @@ -57,6 +38,7 @@ import java.util.Locale; * * @since 1.0 */ +@SuppressWarnings("unused") public final class BukkitUniform implements Uniform { private static BukkitUniform INSTANCE; diff --git a/paper/src/main/java/net/william278/uniform/paper/PaperUniform.java b/paper/src/main/java/net/william278/uniform/paper/PaperUniform.java index e494fcc..1a712de 100644 --- a/paper/src/main/java/net/william278/uniform/paper/PaperUniform.java +++ b/paper/src/main/java/net/william278/uniform/paper/PaperUniform.java @@ -45,11 +45,11 @@ public final class PaperUniform { private PaperUniform(@NotNull JavaPlugin plugin) { if (isUseModernApi()) { PaperCommand.register(plugin, commands); - } else { - plugin.getServer().getPluginManager().registerEvents( - new LegacyPaperCommand.Registrar(plugin, legacyCommands), plugin - ); + return; } + plugin.getServer().getPluginManager().registerEvents( + new LegacyPaperCommand.Registrar(plugin, legacyCommands), plugin + ); } private static boolean isUseModernApi() { @@ -102,9 +102,9 @@ public final class PaperUniform { public void register(@NotNull Command... commands) { if (isUseModernApi()) { register(Arrays.stream(commands).map(PaperCommand::new).toArray(PaperCommand[]::new)); - } else { - register(Arrays.stream(commands).map(LegacyPaperCommand::new).toArray(LegacyPaperCommand[]::new)); + return; } + register(Arrays.stream(commands).map(LegacyPaperCommand::new).toArray(LegacyPaperCommand[]::new)); } }