ProGiple
Пользователь
- Сообщения
- 80
- Решения
- 1
Привет, форумчане! Пишу я плагин и натыкаюсь на ошибку при запуске:
Вот код главного класса:
21 строка - reloadConfig(), что и привело меня в ступор, никогда не сталкивался с этим раньше
Код:
[22:14:10 ERROR]: Error occurred while enabling BAirDrop-FlameAddon v1.0.1 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "Object.toString()" because the return value of "java.util.Map$Entry.getKey()" is null
at org.bukkit.configuration.file.YamlConfiguration.convertMapsToSections(YamlConfiguration.java:78) ~[patched_1.16.5.jar:git-Purpur-1171]
at org.bukkit.configuration.file.YamlConfiguration.convertMapsToSections(YamlConfiguration.java:82) ~[patched_1.16.5.jar:git-Purpur-1171]
at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:72) ~[patched_1.16.5.jar:git-Purpur-1171]
at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:160) ~[patched_1.16.5.jar:git-Purpur-1171]
at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:128) ~[patched_1.16.5.jar:git-Purpur-1171]
at org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(YamlConfiguration.java:188) ~[patched_1.16.5.jar:git-Purpur-1171]
at org.bukkit.plugin.java.JavaPlugin.reloadConfig(JavaPlugin.java:157) ~[patched_1.16.5.jar:git-Purpur-1171]
at org.comp.progiple.bairdropflameaddon.BAirDrop_FlameAddon.onEnable(BAirDrop_FlameAddon.java:21) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.5.jar:git-Purpur-1171]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[patched_1.16.5.jar:git-Purpur-1171]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[patched_1.16.5.jar:git-Purpur-1171]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:518) ~[patched_1.16.5.jar:git-Purpur-1171]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:432) ~[patched_1.16.5.jar:git-Purpur-1171]
at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:596) ~[patched_1.16.5.jar:git-Purpur-1171]
at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:309) ~[patched_1.16.5.jar:git-Purpur-1171]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1074) ~[patched_1.16.5.jar:git-Purpur-1171]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:293) ~[patched_1.16.5.jar:git-Purpur-1171]
at java.lang.Thread.run(Thread.java:831) [?:?]
Java:
package org.comp.progiple.bairdropflameaddon;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
import org.comp.progiple.bairdropflameaddon.Runnables.PlayerRunnable;
import org.comp.progiple.bairdropflameaddon.Runnables.Runnable;
import org.comp.progiple.bairdropflameaddon.Utils.Config;
import org.comp.progiple.bairdropflameaddon.Utils.PAPI.Placeholder;
import java.util.Objects;
public final class BAirDrop_FlameAddon extends JavaPlugin {
@Getter
public static BAirDrop_FlameAddon plugin;
@Override
public void onEnable() {
plugin = this;
saveDefaultConfig();
reloadConfig();
Command command = new Command();
Objects.requireNonNull(getCommand("flamedropaddon")).setExecutor(command);
Objects.requireNonNull(getCommand("flamedropaddon")).setTabCompleter(command);
long delay = Config.getInt("config.airdropSpawn.time") * 20L;
Runnable runnable = new Runnable();
runnable.runTaskTimerAsynchronously(plugin, 0, delay);
PlayerRunnable playerRunnable = new PlayerRunnable();
playerRunnable.runTaskTimerAsynchronously(plugin, 0, 24L);
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
new Placeholder().register();
}
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
}