From c603536bd770f7cfc5bea6338c6c56bc93e09bcb Mon Sep 17 00:00:00 2001 From: Jeremiah Lowe Date: Sat, 3 Dec 2022 21:10:38 -0500 Subject: [PATCH] Refractoring --- .../com/jeremiahbl/bfcmod/BetterForgeChat.java | 15 ++++----------- .../bfcmod/events/ExternalModLoadingEvent.java | 4 ++-- .../utils/{ => moddeps}/FTBNicknameProvider.java | 4 +++- .../utils/{ => moddeps}/LuckPermsProvider.java | 4 +++- 4 files changed, 12 insertions(+), 15 deletions(-) rename src/main/java/com/jeremiahbl/bfcmod/utils/{ => moddeps}/FTBNicknameProvider.java (85%) rename src/main/java/com/jeremiahbl/bfcmod/utils/{ => moddeps}/LuckPermsProvider.java (91%) diff --git a/src/main/java/com/jeremiahbl/bfcmod/BetterForgeChat.java b/src/main/java/com/jeremiahbl/bfcmod/BetterForgeChat.java index e926965..1dbc338 100644 --- a/src/main/java/com/jeremiahbl/bfcmod/BetterForgeChat.java +++ b/src/main/java/com/jeremiahbl/bfcmod/BetterForgeChat.java @@ -1,13 +1,8 @@ package com.jeremiahbl.bfcmod; -import com.jeremiahbl.bfcmod.config.ConfigHandler; -import com.jeremiahbl.bfcmod.config.PermissionsHandler; -import com.jeremiahbl.bfcmod.events.ChatEventHandler; -import com.jeremiahbl.bfcmod.events.CommandRegistrationHandler; -import com.jeremiahbl.bfcmod.events.ExternalModLoadingEvent; -import com.jeremiahbl.bfcmod.events.PlayerEventHandler; -import com.jeremiahbl.bfcmod.utils.IMetadataProvider; -import com.jeremiahbl.bfcmod.utils.INicknameProvider; +import com.jeremiahbl.bfcmod.config.*; +import com.jeremiahbl.bfcmod.events.*; +import com.jeremiahbl.bfcmod.utils.*; import com.mojang.logging.LogUtils; import net.minecraftforge.common.MinecraftForge; @@ -18,8 +13,6 @@ import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.network.NetworkConstants; -import net.minecraftforge.server.permission.PermissionAPI; -import net.minecraftforge.server.permission.nodes.PermissionNode; import org.slf4j.Logger; @@ -35,9 +28,9 @@ public class BetterForgeChat { private ChatEventHandler chatHandler = new ChatEventHandler(); private ExternalModLoadingEvent modLoadingEvent = new ExternalModLoadingEvent(); - private CommandRegistrationHandler commandRegistrator = new CommandRegistrationHandler(); private PlayerEventHandler playerEventHandler = new PlayerEventHandler(); private PermissionsHandler permissionsHandler = new PermissionsHandler(); + private CommandRegistrationHandler commandRegistrator = new CommandRegistrationHandler(); public BetterForgeChat() { instance = this; diff --git a/src/main/java/com/jeremiahbl/bfcmod/events/ExternalModLoadingEvent.java b/src/main/java/com/jeremiahbl/bfcmod/events/ExternalModLoadingEvent.java index e155889..73fb1eb 100644 --- a/src/main/java/com/jeremiahbl/bfcmod/events/ExternalModLoadingEvent.java +++ b/src/main/java/com/jeremiahbl/bfcmod/events/ExternalModLoadingEvent.java @@ -2,8 +2,8 @@ import com.jeremiahbl.bfcmod.BetterForgeChat; import com.jeremiahbl.bfcmod.config.ConfigHandler; -import com.jeremiahbl.bfcmod.utils.FTBNicknameProvider; -import com.jeremiahbl.bfcmod.utils.LuckPermsProvider; +import com.jeremiahbl.bfcmod.utils.moddeps.FTBNicknameProvider; +import com.jeremiahbl.bfcmod.utils.moddeps.LuckPermsProvider; import net.minecraftforge.event.server.ServerStartedEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; diff --git a/src/main/java/com/jeremiahbl/bfcmod/utils/FTBNicknameProvider.java b/src/main/java/com/jeremiahbl/bfcmod/utils/moddeps/FTBNicknameProvider.java similarity index 85% rename from src/main/java/com/jeremiahbl/bfcmod/utils/FTBNicknameProvider.java rename to src/main/java/com/jeremiahbl/bfcmod/utils/moddeps/FTBNicknameProvider.java index 06897b9..ebf912b 100644 --- a/src/main/java/com/jeremiahbl/bfcmod/utils/FTBNicknameProvider.java +++ b/src/main/java/com/jeremiahbl/bfcmod/utils/moddeps/FTBNicknameProvider.java @@ -1,4 +1,6 @@ -package com.jeremiahbl.bfcmod.utils; +package com.jeremiahbl.bfcmod.utils.moddeps; + +import com.jeremiahbl.bfcmod.utils.INicknameProvider; import dev.ftb.mods.ftbessentials.FTBEssentials; import dev.ftb.mods.ftbessentials.util.FTBEPlayerData; diff --git a/src/main/java/com/jeremiahbl/bfcmod/utils/LuckPermsProvider.java b/src/main/java/com/jeremiahbl/bfcmod/utils/moddeps/LuckPermsProvider.java similarity index 91% rename from src/main/java/com/jeremiahbl/bfcmod/utils/LuckPermsProvider.java rename to src/main/java/com/jeremiahbl/bfcmod/utils/moddeps/LuckPermsProvider.java index decdfcb..671becf 100644 --- a/src/main/java/com/jeremiahbl/bfcmod/utils/LuckPermsProvider.java +++ b/src/main/java/com/jeremiahbl/bfcmod/utils/moddeps/LuckPermsProvider.java @@ -1,7 +1,9 @@ -package com.jeremiahbl.bfcmod.utils; +package com.jeremiahbl.bfcmod.utils.moddeps; import org.checkerframework.checker.nullness.qual.NonNull; +import com.jeremiahbl.bfcmod.utils.IMetadataProvider; + import net.luckperms.api.LuckPerms; import net.luckperms.api.cacheddata.CachedMetaData; import net.luckperms.api.model.user.User;