Search in sources :

Example 1 with InteractionVisualizerReloadEvent

use of com.loohp.interactionvisualizer.api.events.InteractionVisualizerReloadEvent in project InteractionVisualizer by LOOHP.

the class InteractionVisualizer method loadConfig.

public void loadConfig() {
    Config config = Config.getConfig(CONFIG_ID);
    config.reload();
    itemStandEnabled = getConfiguration().getBoolean("Modules.ItemStand.Enabled");
    itemDropEnabled = getConfiguration().getBoolean("Modules.ItemDrop.Enabled");
    hologramsEnabled = getConfiguration().getBoolean("Modules.Hologram.Enabled");
    itemStandDisabled = getConfiguration().getStringList("Modules.ItemStand.OverridingDisabled").stream().map(each -> new EntryKey(each)).collect(Collectors.toSet());
    itemDropDisabled = getConfiguration().getStringList("Modules.ItemDrop.OverridingDisabled").stream().map(each -> new EntryKey(each)).collect(Collectors.toSet());
    hologramsDisabled = getConfiguration().getStringList("Modules.Hologram.OverridingDisabled").stream().map(each -> new EntryKey(each)).collect(Collectors.toSet());
    playerPickupYOffset = getConfiguration().getDouble("Settings.PickupAnimationPlayerYOffset");
    tileEntityCheckingRange = getConfiguration().getInt("TileEntityUpdate.CheckingRange");
    ignoreWalkSquared = getConfiguration().getDouble("TileEntityUpdate.IgnoreMovementSpeed.Normal");
    ignoreWalkSquared *= ignoreWalkSquared;
    ignoreFlySquared = getConfiguration().getDouble("TileEntityUpdate.IgnoreMovementSpeed.Flying");
    ignoreFlySquared *= ignoreFlySquared;
    ignoreGlideSquared = getConfiguration().getDouble("TileEntityUpdate.IgnoreMovementSpeed.Gliding");
    ignoreGlideSquared *= ignoreGlideSquared;
    handMovementEnabled = getConfiguration().getBoolean("Settings.UseHandSwingAnimation");
    disabledWorlds = new HashSet<>(getConfiguration().getStringList("Settings.DisabledWorlds"));
    hideIfObstructed = getConfiguration().getBoolean("Settings.HideIfViewObstructed");
    lightUpdatePeriod = getConfiguration().getInt("LightUpdate.Period");
    updaterEnabled = getConfiguration().getBoolean("Options.Updater");
    language = getConfiguration().getString("Settings.Language");
    playerTrackingRange.clear();
    int defaultRange = getServer().spigot().getConfig().getInt("world-settings.default.entity-tracking-range.players", 64);
    for (World world : getServer().getWorlds()) {
        int range = getServer().spigot().getConfig().getInt("world-settings." + world.getName() + ".entity-tracking-range.players", defaultRange);
        playerTrackingRange.put(world, range);
    }
    allPacketsSync = getConfiguration().getBoolean("Settings.SendAllPacketsInSync");
    defaultDisabledAll = getConfiguration().getBoolean("Settings.DefaultDisableAll");
    LanguageUtils.loadTranslations(language);
    getServer().getPluginManager().callEvent(new InteractionVisualizerReloadEvent());
}
Also used : InteractionVisualizerReloadEvent(com.loohp.interactionvisualizer.api.events.InteractionVisualizerReloadEvent) EntryKey(com.loohp.interactionvisualizer.objectholders.EntryKey) Config(com.loohp.interactionvisualizer.config.Config) World(org.bukkit.World)

Aggregations

InteractionVisualizerReloadEvent (com.loohp.interactionvisualizer.api.events.InteractionVisualizerReloadEvent)1 Config (com.loohp.interactionvisualizer.config.Config)1 EntryKey (com.loohp.interactionvisualizer.objectholders.EntryKey)1 World (org.bukkit.World)1