fancydialogs: Refactor FancyNpcs integration

This commit is contained in:
Oliver
2025-06-17 17:50:19 +02:00
parent 2953b62c74
commit 8ffe3f824c
3 changed files with 9 additions and 10 deletions

View File

@@ -93,11 +93,11 @@ tasks {
minecraftVersion("1.21.6")
downloadPlugins {
modrinth("fancynpcs", "2.5.0")
hangar("ViaVersion", "5.3.2")
hangar("ViaBackwards", "5.3.2")
// modrinth("fancynpcs", "2.5.0")
// hangar("ViaVersion", "5.3.2")
// hangar("ViaBackwards", "5.3.2")
// modrinth("multiverse-core", "4.3.11")
hangar("PlaceholderAPI", "2.11.6")
// hangar("PlaceholderAPI", "2.11.6")
}
}

View File

@@ -141,7 +141,9 @@ public class FancyDialogsPlugin extends JavaPlugin implements FancyDialogs {
registerCommands();
// FancyNpcs actions
new OpenDialogNpcAction().register();
if (Bukkit.getPluginManager().isPluginEnabled("FancyNpcs")) {
new OpenDialogNpcAction().register();
}
fancyLogger.info("Successfully enabled FancyDialogs version %s".formatted(getDescription().getVersion()));
}

View File

@@ -5,7 +5,6 @@ import com.fancyinnovations.fancydialogs.api.Dialog;
import de.oliver.fancynpcs.api.FancyNpcsPlugin;
import de.oliver.fancynpcs.api.actions.NpcAction;
import de.oliver.fancynpcs.api.actions.executor.ActionExecutionContext;
import org.bukkit.Bukkit;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -27,9 +26,7 @@ public class OpenDialogNpcAction extends NpcAction {
}
public void register() {
if (Bukkit.getPluginManager().isPluginEnabled("FancyNpcs")) {
FancyNpcsPlugin.get().getActionManager().registerAction(this);
FancyDialogsPlugin.get().getFancyLogger().info("Registered NPC action 'open_dialog' for FancyNpcs.");
}
FancyNpcsPlugin.get().getActionManager().registerAction(this);
FancyDialogsPlugin.get().getFancyLogger().info("Registered NPC action 'open_dialog' for FancyNpcs.");
}
}