Add ConfigUpdater
Add LinkageType.CONFIG_CONVERTER
Dieser Commit ist enthalten in:
Ursprung
c9af5326d1
Commit
8944a64d6b
@ -0,0 +1,17 @@
|
|||||||
|
package de.steamwar.bausystem.configplayer;
|
||||||
|
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@UtilityClass
|
||||||
|
public class ConfigUpdater {
|
||||||
|
|
||||||
|
private static final Map<Integer, ConfigConverter> CONFIG_CONVERTER_MAP = new HashMap<>();
|
||||||
|
|
||||||
|
public static void addConfigConverter(ConfigConverter configConverter) {
|
||||||
|
CONFIG_CONVERTER_MAP.putIfAbsent(configConverter.version(), configConverter);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -20,6 +20,8 @@
|
|||||||
package de.steamwar.bausystem.linkage;
|
package de.steamwar.bausystem.linkage;
|
||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
|
import de.steamwar.bausystem.configplayer.ConfigConverter;
|
||||||
|
import de.steamwar.bausystem.configplayer.ConfigUpdater;
|
||||||
import de.steamwar.bausystem.features.gui.BauGUI;
|
import de.steamwar.bausystem.features.gui.BauGUI;
|
||||||
import de.steamwar.bausystem.features.script.ScriptExecutor;
|
import de.steamwar.bausystem.features.script.ScriptExecutor;
|
||||||
import de.steamwar.bausystem.features.script.SpecialCommand;
|
import de.steamwar.bausystem.features.script.SpecialCommand;
|
||||||
@ -45,7 +47,8 @@ public enum LinkageType {
|
|||||||
LISTENER(2, false, Listener.class::isAssignableFrom, o -> Bukkit.getPluginManager().registerEvents((Listener) o, BauSystem.getInstance())),
|
LISTENER(2, false, Listener.class::isAssignableFrom, o -> Bukkit.getPluginManager().registerEvents((Listener) o, BauSystem.getInstance())),
|
||||||
UNLINK_LISTENER(2, true, Listener.class::isAssignableFrom, o -> HandlerList.unregisterAll((Listener) o)),
|
UNLINK_LISTENER(2, true, Listener.class::isAssignableFrom, o -> HandlerList.unregisterAll((Listener) o)),
|
||||||
GUI_ITEM(3, false, GuiItem.class::isAssignableFrom, o -> BauGUI.addItem((GuiItem) o)),
|
GUI_ITEM(3, false, GuiItem.class::isAssignableFrom, o -> BauGUI.addItem((GuiItem) o)),
|
||||||
SCRIPT_COMMAND(4, false, SpecialCommand.class::isAssignableFrom, o -> ScriptExecutor.SPECIAL_COMMANDS.add((SpecialCommand) o));
|
SCRIPT_COMMAND(4, false, SpecialCommand.class::isAssignableFrom, o -> ScriptExecutor.SPECIAL_COMMANDS.add((SpecialCommand) o)),
|
||||||
|
CONFIG_CONVERTER(5, false, ConfigConverter.class::isAssignableFrom, o -> ConfigUpdater.addConfigConverter((ConfigConverter) o));
|
||||||
|
|
||||||
private final int order;
|
private final int order;
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren