Ensure configurable object is converted from map to object on /papi reload

This commit is contained in:
PiggyPiglet
2026-02-19 19:11:37 +08:00
parent 20aa9042f3
commit 0067540ec1
2 changed files with 35 additions and 15 deletions

View File

@@ -2,6 +2,7 @@ package at.helpch.placeholderapi;
import at.helpch.placeholderapi.commands.PlaceholderCommandRouter;
import at.helpch.placeholderapi.configuration.ConfigManager;
import at.helpch.placeholderapi.expansion.PlaceholderExpansion;
import at.helpch.placeholderapi.expansion.manager.CloudExpansionManager;
import at.helpch.placeholderapi.expansion.manager.LocalExpansionManager;
import at.helpch.placeholderapi.metrics.MetricsManager;
@@ -78,6 +79,12 @@ public class PlaceholderAPIPlugin extends JavaPlugin {
configManager.setup();
localExpansionManager.load(sender);
for (final PlaceholderExpansion expansion : localExpansionManager.getExpansions()) {
if (expansion.getExpansionType() == PlaceholderExpansion.Type.INTERNAL) {
// when the config gets reloaded, getConfig for internal expansions will return a map instead of the correct object
localExpansionManager.createConfig(expansion);
}
}
if (configManager.config().cloudEnabled()) {
cloudExpansionManager.load();