Tanri09YT
Пользователь
- Сообщения
- 36
Разрешается выкладывание кода, файлов конфигураций, логов и т.д. только под BB-код CODE
(Я начинающий кодер если что)
И у меня не виден плагин на сервере, который я скомпилировал так же в консоли сервера возникает такая ошибка:
[21:01:00 ERROR]: Error occurred while enabling super-ec v1.0.0 (Is it up to date?)
java.lang.NullPointerException: null
at yt.tanr1.superec.Super_ec.onEnable(Super_ec.java:16) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:518) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:432) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.reload(CraftServer.java:965) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.Bukkit.reload(Bukkit.java:726) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:54) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.dispatchCommand(CraftServer.java:826) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.PlayerConnection.handleCommand(PlayerConnection.java:2185) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.PlayerConnection.c(PlayerConnection.java:2000) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.PlayerConnection.a(PlayerConnection.java:1953) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.PacketPlayInChat.a(PacketPlayInChat.java:49) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.PacketPlayInChat.a(PacketPlayInChat.java:7) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:35) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.TickTask.run(SourceFile:18) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.MinecraftServer.bb(MinecraftServer.java:1271) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.MinecraftServer.executeNext(MinecraftServer.java:1264) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.MinecraftServer.sleepForTick(MinecraftServer.java:1225) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1139) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-794]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_351]
[21:01:00 INFO]: [super-ec] Disabling super-ec v1.0.0
Так же такие у меня коды выходят:
Plugin.yml:
name: super-ec
version: '1.0.0'
main: yt.tanr1.superec.Super_ec
api-version: '1.16'
command:
super-ec:
aliaces:
usage: /<command>
Super_ec:
package yt.tanr1.superec;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandExecutor;
import org.bukkit.plugin.java.JavaPlugin;
import yt.tanr1.superec.command.SuperEc;
public final class Super_ec extends JavaPlugin {
@Override
public void onEnable() {
getServer().getLogger().info(ChatColor.GRAY + "------------");
getServer().getLogger().info(ChatColor.GOLD + "SuperEc Plugin ");
getServer().getLogger().info(ChatColor.GREEN + " Enabled ");
getServer().getLogger().info(ChatColor.GRAY + "------------");
getServer().getPluginCommand("super-ec").setExecutor(new SuperEc());
}
@Override
public void onDisable() {
getServer().getLogger().info(ChatColor.GRAY + "------------");
getServer().getLogger().info(ChatColor.GOLD + "SuperEc Plugin ");
getServer().getLogger().info(ChatColor.RED + " Disable ");
getServer().getLogger().info(ChatColor.GRAY + "------------");
}
}
SuperEс:
package yt.tanr1.superec.command;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
public class SuperEc implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String Label, String [] args) {
if (!(sender instanceof Player)) return true;
if (args.length != 0) return false;
Player player = (Player) sender;
Inventory superec = Bukkit.createInventory(player, 9, ChatColor.GRAY + "Супер эндер сундук");
ItemStack swords = new ItemStack(Material.DIAMOND_SWORD, 3);
superec.setItem(getIndex(1, 8), swords);
player.openInventory(superec);
return true;
}
private int getIndex(int row, int column) {
return (row - 1) * 9 + column - 1;
}
}
Как думаете, с чем это связано и как решить?
И у меня не виден плагин на сервере, который я скомпилировал так же в консоли сервера возникает такая ошибка:
[21:01:00 ERROR]: Error occurred while enabling super-ec v1.0.0 (Is it up to date?)
java.lang.NullPointerException: null
at yt.tanr1.superec.Super_ec.onEnable(Super_ec.java:16) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:518) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:432) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.reload(CraftServer.java:965) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.Bukkit.reload(Bukkit.java:726) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:54) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.dispatchCommand(CraftServer.java:826) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.PlayerConnection.handleCommand(PlayerConnection.java:2185) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.PlayerConnection.c(PlayerConnection.java:2000) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.PlayerConnection.a(PlayerConnection.java:1953) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.PacketPlayInChat.a(PacketPlayInChat.java:49) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.PacketPlayInChat.a(PacketPlayInChat.java:7) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:35) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.TickTask.run(SourceFile:18) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.MinecraftServer.bb(MinecraftServer.java:1271) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.MinecraftServer.executeNext(MinecraftServer.java:1264) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.MinecraftServer.sleepForTick(MinecraftServer.java:1225) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1139) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-794]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_351]
[21:01:00 INFO]: [super-ec] Disabling super-ec v1.0.0
Так же такие у меня коды выходят:
Plugin.yml:
name: super-ec
version: '1.0.0'
main: yt.tanr1.superec.Super_ec
api-version: '1.16'
command:
super-ec:
aliaces:
- se
- super_ender_chest
usage: /<command>
Super_ec:
package yt.tanr1.superec;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandExecutor;
import org.bukkit.plugin.java.JavaPlugin;
import yt.tanr1.superec.command.SuperEc;
public final class Super_ec extends JavaPlugin {
@Override
public void onEnable() {
getServer().getLogger().info(ChatColor.GRAY + "------------");
getServer().getLogger().info(ChatColor.GOLD + "SuperEc Plugin ");
getServer().getLogger().info(ChatColor.GREEN + " Enabled ");
getServer().getLogger().info(ChatColor.GRAY + "------------");
getServer().getPluginCommand("super-ec").setExecutor(new SuperEc());
}
@Override
public void onDisable() {
getServer().getLogger().info(ChatColor.GRAY + "------------");
getServer().getLogger().info(ChatColor.GOLD + "SuperEc Plugin ");
getServer().getLogger().info(ChatColor.RED + " Disable ");
getServer().getLogger().info(ChatColor.GRAY + "------------");
}
}
SuperEс:
package yt.tanr1.superec.command;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
public class SuperEc implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String Label, String [] args) {
if (!(sender instanceof Player)) return true;
if (args.length != 0) return false;
Player player = (Player) sender;
Inventory superec = Bukkit.createInventory(player, 9, ChatColor.GRAY + "Супер эндер сундук");
ItemStack swords = new ItemStack(Material.DIAMOND_SWORD, 3);
superec.setItem(getIndex(1, 8), swords);
player.openInventory(superec);
return true;
}
private int getIndex(int row, int column) {
return (row - 1) * 9 + column - 1;
}
}
Как думаете, с чем это связано и как решить?