mirror of
https://github.com/FancyInnovations/FancyPlugins.git
synced 2025-12-06 07:43:36 +00:00
fancydialogs: Refactor FancyNpcs integration
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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()));
|
||||
}
|
||||
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user