My plugin is recognized as outdated?

gl
- in Plugins
45

I program a Minecraft plugin and suddenly it is updated. This is what the error message looks like:

[00:27:12 ERROR]: Error occurred while enabling Lobby v1.0 (Is it up to date?)

I have removed all predicated things in this plugin, but nothing has changed. What could be the reason that my plugin is recognized as outdated and how can I fix it?

St

This is the standard output in the event of an error and says nothing at all. The real mistake should be underneath. It's best to send the whole log.

gl

But there's nothing underneath…

It now looks like this:

[00:00:52 ERROR]: Error occurred while enabling Lobby v1.0 (Is it up to date?)

[00:00:52 ERROR]: Error occurred while enabling ********** v1.0 (Is it up to date?)

[00:03:15 ERROR]: Error occurred while enabling Lobby v1.0 (Is it up to date?)

[00:03:15 ERROR]: Error occurred while enabling ********** v1.0 (Is it up to date?)

[00:27:12 ERROR]: Error occurred while enabling Lobby v1.0 (Is it up to date?)

[00:27:12 ERROR]: Error occurred while enabling ********** v1.0 (Is it up to date?)

[00:27:12 ERROR]: Error occurred while enabling Lobby v1.0 (Is it up to date?)

[00:27:12 ERROR]: Error occurred while enabling ********** v1.0 (Is it up to date?)

[00:32:38 ERROR]: Error occurred while enabling Lobby v1.0 (Is it up to date?)

[00:32:38 ERROR]: Error occurred while enabling ********** v1.0 (Is it up to date?)

St

Possibly also about it. As I said, the best thing to do is upload the whole log.

gl

[00:00:52 ERROR]: Error occurred while enabling Lobby v1.0 (Is it up to date?)

[00:00:52 ERROR]: Error occurred while enabling ********** v1.0 (Is it up to date?)

[00:03:15 ERROR]: Error occurred while enabling Lobby v1.0 (Is it up to date?)

[00:03:15 ERROR]: Error occurred while enabling ********** v1.0 (Is it up to date?)

[00:27:12 ERROR]: Error occurred while enabling Lobby v1.0 (Is it up to date?)

[00:27:12 ERROR]: Error occurred while enabling ********** v1.0 (Is it up to date?)

[00:27:12 ERROR]: Error occurred while enabling Lobby v1.0 (Is it up to date?)

[00:27:12 ERROR]: Error occurred while enabling ********** v1.0 (Is it up to date?)

[00:32:38 ERROR]: Error occurred while enabling Lobby v1.0 (Is it up to date?)

[00:32:38 ERROR]: Error occurred while enabling ********** v1.0 (Is it up to date?)

gl

With Minehub you can hide information, warnings, erros or several things at once in the console, and I did not notice that I have hidden the information xD

I have now displayed the information again and this is how it looks now:

[00:46:30 INFO]: [Lobby] Enabling Lobby v1.0

[00:46:30 ERROR]: Error occurred while enabling Lobby v1.0 (Is it up to date?)

java.lang.NoClassDefFoundError: net / minecraft / server / v1_8_R3 / Packet

at net. **********. Lobby.main.Main.onEnable (Main.java:26) ~ [?:?]

at org.bukkit.plugin.java.JavaPlugin.setEnabled (JavaPlugin.java:321) ~ [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin (JavaPluginLoader.java:335) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.plugin.SimplePluginManager.enablePlugin (SimplePluginManager.java:405) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.craftbukkit.v1_8_R1.CraftServer.loadPlugin (CraftServer.java:356) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.craftbukkit.v1_8_R1.CraftServer.enablePlugins (CraftServer.java:316) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.craftbukkit.v1_8_R1.CraftServer.reload (CraftServer.java:746) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.Bukkit.reload (Bukkit.java:534) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.command.defaults.ReloadCommand.execute (ReloadCommand.java:25) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.command.SimpleCommandMap.dispatch (SimpleCommandMap.java:141) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand (CraftServer.java:646) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at net.minecraft.server.v1_8_R1.PlayerConnection.handleCommand (PlayerConnection.java:1115) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at net.minecraft.server.v1_8_R1.PlayerConnection.a (PlayerConnection.java:950) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at net.minecraft.server.v1_8_R1.PacketPlayInChat.a (PacketPlayInChat.java:26) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at net.minecraft.server.v1_8_R1.PacketPlayInChat.a (PacketPlayInChat.java:53) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at net.minecraft.server.v1_8_R1.PacketHandleTask.run (SourceFile: 13) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at java.util.concurrent.Executors $ RunnableAdapter.call (Executors.java:511) [?: 1.8.0_212]

at java.util.concurrent.FutureTask.run (FutureTask.java:266) [?: 1.8.0_212]

at net.minecraft.server.v1_8_R1.MinecraftServer.z (MinecraftServer.java:696) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at net.minecraft.server.v1_8_R1.DedicatedServer.z (DedicatedServer.java:316) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at net.minecraft.server.v1_8_R1.MinecraftServer.y (MinecraftServer.java:634) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at net.minecraft.server.v1_8_R1.MinecraftServer.run (MinecraftServer.java:537) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at java.lang.Thread.run (Thread.java:748) [?: 1.8.0_212]

Caused by: java.lang.ClassNotFoundException: net.minecraft.server.v1_8_R3.Packet

at org.bukkit.plugin.java.PluginClassLoader.findClass (PluginClassLoader.java:91) ~ [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.plugin.java.PluginClassLoader.findClass (PluginClassLoader.java:86) ~ [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at java.lang.ClassLoader.loadClass (ClassLoader.java:424) ~ [?: 1.8.0_212]

at java.lang.ClassLoader.loadClass (ClassLoader.java:357) ~ [?: 1.8.0_212]

… 23 more

St

Now you try to use the packet class of 1.8.3 on 1.8.1, you can't, you have to change the import.

It is best to use Java Reflections in NMS classes. Although this is much more difficult to write, the same plugin also works on other versions without having to change the code.

gl

What do I have to change the import to and what is NMS?

St

The classes are in net.minecraft.server.v1_8_R1.

NMS is simply an acronym for net.minecraft.server.

gl

So I just have to write v1_8_R3 instead of v1_8_R1?

St

Exactly

gl

Wait, or do I have to do it the other way around?

With the imports there's v1_8_R3 everywhere and the error message still comes.

St

Yes, I was not careful. You also have to make sure that you then use the corresponding Jar as a library, otherwise you will have a compile-time error.

gl

And how do I do that?

gl

Aquaman? Are you there?

St

Just as it is now, only with the 1.8.1 Jar and not the 1.8.3. I don't know how you did it.

gl

But I didn't choose any libraries…

St

Then you can't compile any Bukkit plugins either. You have to know how you set up the development environment for Bukkit.

gl

Oh, I use Eclipse, but I still don't know what to do.

St

Now there will be Bukkit 1.8.3 somewhere among the libraries, you have to replace that.

gl

And where do I see the libraries? XD

St

https://wiki.eclipse.org/FAQ_How_do_I_add_an_extra_library_to_my_project%27s_classpath%3F

You should have already done it.

gl

That's right, I've already done that xD

But somehow I still don't quite understand exactly what I need to change. Do I have to change the version?

I added an image in the question addition. Maybe you have to rename the highlighted one?

St

Remove the previous jar and add the 1.8.1 jar again. This should all go in the configuration window specified in the Eclipse help page.

gl

OK thanks

I did this with both plugins, but one of them is still recognized as outdated xD

St

As I said, this is the normal output for errors. Take a look at the exception. If you don't understand them, you can send them here.

gl

Now it doesn't work for either of them.

So these are the whole error messages of the plugins:

[18:20:05 ERROR]: Error occurred while enabling Lobby v1.8 (Is it up to date?)

java.lang.NoClassDefFoundError: net / minecraft / server / v1_8_R3 / Packet

at net. **********. Lobby.main.Main.onEnable (Main.java:26) ~ [?:?]

at org.bukkit.plugin.java.JavaPlugin.setEnabled (JavaPlugin.java:321) ~ [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin (JavaPluginLoader.java:335) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.plugin.SimplePluginManager.enablePlugin (SimplePluginManager.java:405) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.craftbukkit.v1_8_R1.CraftServer.loadPlugin (CraftServer.java:356) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.craftbukkit.v1_8_R1.CraftServer.enablePlugins (CraftServer.java:316) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.craftbukkit.v1_8_R1.CraftServer.reload (CraftServer.java:746) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.Bukkit.reload (Bukkit.java:534) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.command.defaults.ReloadCommand.execute (ReloadCommand.java:25) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.command.SimpleCommandMap.dispatch (SimpleCommandMap.java:141) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand (CraftServer.java:646) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchServerCommand (CraftServer.java:632) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at net.minecraft.server.v1_8_R1.DedicatedServer.aM (DedicatedServer.java:353) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at net.minecraft.server.v1_8_R1.DedicatedServer.z (DedicatedServer.java:317) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at net.minecraft.server.v1_8_R1.MinecraftServer.y (MinecraftServer.java:634) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at net.minecraft.server.v1_8_R1.MinecraftServer.run (MinecraftServer.java:537) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at java.lang.Thread.run (Thread.java:748) [?: 1.8.0_212]

Caused by: java.lang.ClassNotFoundException: net.minecraft.server.v1_8_R3.Packet

at org.bukkit.plugin.java.PluginClassLoader.findClass (PluginClassLoader.java:91) ~ [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.plugin.java.PluginClassLoader.findClass (PluginClassLoader.java:86) ~ [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at java.lang.ClassLoader.loadClass (ClassLoader.java:424) ~ [?: 1.8.0_212]

at java.lang.ClassLoader.loadClass (ClassLoader.java:357) ~ [?: 1.8.0_212]

… 17 more

[18:20:05 INFO]: [*************] Enabling ************** v1.8

[18:20:05 ERROR]: Error occurred while enabling ************* v1.8 (Is it up to date?)

java.lang.NullPointerException

at net. **********. Main.Main.onEnable (Main.java:90) ~ [?:?]

at org.bukkit.plugin.java.JavaPlugin.setEnabled (JavaPlugin.java:321) ~ [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin (JavaPluginLoader.java:335) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.plugin.SimplePluginManager.enablePlugin (SimplePluginManager.java:405) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.craftbukkit.v1_8_R1.CraftServer.loadPlugin (CraftServer.java:356) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.craftbukkit.v1_8_R1.CraftServer.enablePlugins (CraftServer.java:316) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.craftbukkit.v1_8_R1.CraftServer.reload (CraftServer.java:746) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.Bukkit.reload (Bukkit.java:534) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.command.defaults.ReloadCommand.execute (ReloadCommand.java:25) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.command.SimpleCommandMap.dispatch (SimpleCommandMap.java:141) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand (CraftServer.java:646) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchServerCommand (CraftServer.java:632) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at net.minecraft.server.v1_8_R1.DedicatedServer.aM (DedicatedServer.java:353) [spigot-1.8.jar: git-Spigot-550ebac-7019900]

at net.minecraft.server.v1_8_R1.DedicatedServer.z (DedicatedServer.java:317) [

St

This should actually be clear:

java.lang.NoClassDefFoundError: net / minecraft / server / v1_8_R3 / Packet

Import in Main.java, line 26.

Here you try to use a null value, of course you can't:

java.lang.NullPointerException
at net. **********. Main.Main.onEnable (Main.java:90) ~ [?:?]

gl

Ok I fixed the error in line 90, but the import in line 26 is correct:

import net. **********. Commands.Tpaccept;

The class is called Tpaccept.java, is public and is also in the right package.

Do you know why the class is still not recognized?

St

Then the plugin in the server does not match your current code. Did you replace it at all? Packet is imported in the incorrect line.

gl

Yes, of course I replaced xD

This is the error message:

[20:35:26 ERROR]: Error occurred while enabling Lobby v1.8 (Is it up to date?)
java.lang.NoClassDefFoundError: net / minecraft / server / v1_8_R3 / Packet
at net.mcjavaplay.lobby.main.Main.onEnable (Main.java:26) ~ [?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled (JavaPlugin.java:321) ~ [spigot-1.8.jar: git-Spigot-550ebac-7019900]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin (JavaPluginLoader.java:335) [spigot-1.8.jar: git-Spigot-550ebac-7019900]
at org.bukkit.plugin.SimplePluginManager.enablePlugin (SimplePluginManager.java:405) [spigot-1.8.jar: git-Spigot-550ebac-7019900]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.loadPlugin (CraftServer.java:356) [spigot-1.8.jar: git-Spigot-550ebac-7019900]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.enablePlugins (CraftServer.java:316) [spigot-1.8.jar: git-Spigot-550ebac-7019900]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.reload (CraftServer.java:746) [spigot-1.8.jar: git-Spigot-550ebac-7019900]
at org.bukkit.Bukkit.reload (Bukkit.java:534) [spigot-1.8.jar: git-Spigot-550ebac-7019900]
at org.bukkit.command.defaults.ReloadCommand.execute (ReloadCommand.java:25) [spigot-1.8.jar: git-Spigot-550ebac-7019900]
at org.bukkit.command.SimpleCommandMap.dispatch (SimpleCommandMap.java:141) [spigot-1.8.jar: git-Spigot-550ebac-7019900]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand (CraftServer.java:646) [spigot-1.8.jar: git-Spigot-550ebac-7019900]
at net.minecraft.server.v1_8_R1.PlayerConnection.handleCommand (PlayerConnection.java:1115) [spigot-1.8.jar: git-Spigot-550ebac-7019900]
at net.minecraft.server.v1_8_R1.PlayerConnection.a (PlayerConnection.java:950) [spigot-1.8.jar: git-Spigot-550ebac-7019900]
at net.minecraft.server.v1_8_R1.PacketPlayInChat.a (PacketPlayInChat.java:26) [spigot-1.8.jar: git-Spigot-550ebac-7019900]
at net.minecraft.server.v1_8_R1.PacketPlayInChat.a (PacketPlayInChat.java:53) [spigot-1.8.jar: git-Spigot-550ebac-7019900]
at net.minecraft.server.v1_8_R1.PacketHandleTask.run (SourceFile: 13) [spigot-1.8.jar: git-Spigot-550ebac-7019900]
at java.util.concurrent.Executors $ RunnableAdapter.call (Executors.java:511) [?: 1.8.0_212]
at java.util.concurrent.FutureTask.run (FutureTask.java:266) [?: 1.8.0_212]
at net.minecraft.server.v1_8_R1.MinecraftServer.z (MinecraftServer.java:696) [spigot-1.8.jar: git-Spigot-550ebac-7019900]
at net.minecraft.server.v1_8_R1.DedicatedServer.z (DedicatedServer.java:316) [spigot-1.8.jar: git-Spigot-550ebac-7019900]
at net.minecraft.server.v1_8_R1.MinecraftServer.y (MinecraftServer.java:634) [spigot-1.8.jar: git-Spigot-550ebac-7019900]
at net.minecraft.server.v1_8_R1.MinecraftServer.run (MinecraftServer.java:537) [spigot-1.8.jar: git-Spigot-550ebac-7019900]
at java.lang.Thread.run (Thread.java:748) [?: 1.8.0_212]
Caused by: java.lang.ClassNotFoundException: net.minecraft.server.v1_8_R3.Packet
at org.bukkit.plugin.java.PluginClassLoader.findClass (PluginClassLoader.java:91) ~ [spigot-1.8.jar: git-Spigot-550ebac-7019900]
at org.bukkit.plugin.java.PluginClassLoader.findClass (PluginClassLoader.java:86) ~ [spigot-1.8.jar: git-Spigot-550ebac-7019900]
at java.lang.ClassLoader.loadClass (ClassLoader.java:424) ~ [?: 1.8.0_212]
at java.lang.ClassLoader.loadClass (ClassLoader.java:357) ~ [?: 1.8.0_212]
… 23 more

Again, I don't quite understand the error message - on which line do I have to search for the error? 91? 86?

St

So at the top of the output of an exception is the name (in the case NoClassDefFoundError, i.e. Class not found), which is usually followed by An explanation (here: which class was not found).

Below this is the location where the error occurred (class, method, file and line in brackets). Below that, the whole thing continues, it is listed recursively from where the error was called, but in this case it is not relevant.

gl

So do I have to search in line 91?

St

There it says:

at net.mcjavaplay.lobby.main.Main.onEnable (Main.java:26)

gl

Oh bruh xD

Then I'll take a look

gl

In line 26, a listener class is registered that contains 2 listeners.

The two listeners are public and the class name is spelled correctly.

What else could it be? Should I send you the code?

St

Just search for "v1_8_R3" in all files, it has to be somewhere else, otherwise the error could not occur.

gl

Ok I found 4 imports with v1_8_R3.

They are there to display a message in the action bar:

import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
import net.minecraft.server.v1_8_R3.IChatBaseComponent;
import net.minecraft.server.v1_8_R3.IChatBaseComponent.ChatSerializer;
import net.minecraft.server.v1_8_R3.PacketPlayOutChat;

Can you display a message in the action bar without all the stuff?

At player.spigot (). SendMessage (ChatType.ACTIONBAR, "text"); (or something like that) is said that ChatType.ACTIONBAR has to be done away with, but that's exactly what I want. Because it doesn't work, I did all the icbc and stuff, but apparently that's a problem too.

St

The problem, as I said, is that you import 1.8.3 classes into 1.8.1. You have to adjust all imports.

The function mentioned is only available in the Bukkit API from 1.9.

gl

The server is actually running on 1.8 and not on 1.8.1 … I just checked.

If I adjust the imports, they will be shown as incorrect.

But there are plugins with which you can display messages in the action bar, even though the server is at 1.8. Can you somehow see the code in the plugins? XD

And what actually happens if I rename the highlighted when adding questions?

St

If I adjust the imports, they will be shown as incorrect.

Then you didn't add the Spigot Jar correctly as a library.

gl

I did it exactly as BiVieh showed it in its YouTube tutorials.

St

But you need the right version of it. It just makes no sense in a circle here, I can hardly help you if you don't even have a basic understanding of how it works.

gl

I know what you mean and I did it right.

The build path is spigot.jar (version 1.8), but I can only import 1.8.3 things.

St

I know what you mean and I did it right.

Obviously not, otherwise you could import the classes.

There's also the question of why you do not simply change the version of the server, there's actually nothing against a newer minor version.

gl

There's also the question of why you do not simply change the version of the server, there's actually nothing against a newer minor version.

True xD

Then I do it like this