Inconsistencies when deploying plugin to server

Discussion in 'Spigot Plugin Development' started by SirLich, Jul 6, 2018.

  1. Hey guys.
    I am wondering what sort of issues would be causing my server to run just great on Localhost, but throw a zillion errors when loaded onto hosting (MelonCube)?

    My code can be found here:

    The issues look like this:
    Code (Text):

    [21:16:46] [Server thread/WARN]: java.lang.NoSuchMethodException:<init>(net.minecraft.server.v1_12_R1.World)
    [21:16:46] [Server thread/WARN]:     at java.lang.Class.getConstructor0(
    [21:16:46] [Server thread/WARN]:     at java.lang.Class.getConstructor(
    [21:16:46] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.EntityTypes.a(SourceFile:155)
    [21:16:46] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.EntityTypes.a(SourceFile:169)
    [21:16:46] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.EntityTypes.a(SourceFile:176)
    [21:16:46] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.ChunkRegionLoader.a(
    [21:16:46] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.ChunkRegionLoader.a(
    [21:16:46] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.ChunkRegionLoader.loadEntities(
    [21:16:46] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOProvider.callStage2(
    [21:16:46] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOProvider.callStage2(
    [21:16:46] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_12_R1.util.AsynchronousExecutor$Task.finish(
    [21:16:46] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_12_R1.util.AsynchronousExecutor.finishActive(
    [21:16:46] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOExecutor.tick(
    [21:16:46] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.MinecraftServer.D(
    [21:16:46] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.DedicatedServer.D(
    [21:16:46] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.MinecraftServer.C(
    [21:16:46] [Server thread/WARN]:     at
    [21:16:46] [Server thread/WARN]:     at
    [21:16:46] [Server thread/WARN]: Skipping Entity with id minecraft:civilian

    This only appears to happen when a player logs in, not during the reload (or restart) of the plugin.
    The plugin itself is loaded... correctly, in the sense that commands and listeners are working as intended.

    Also of note: This is a new error that just seems to have occurred with my most recent version of the plugin. Before that stuff seems to work normal??

    The biggest weirdness is inconsistancy. Sometimes it will load 1 NPC, sometimes both NPC's, sometimes no NPC's. Sometimes it loads the NPC, and clicking him kicks me. Sometimes it loads NPC, and I can do ALL npc actions normal.

    Much love for the help <3
  2. ScarabCoder

    ScarabCoder Retired Resource Staff

    Did you check the compiled jar to make sure the classes are there?
    How are you compiling it, using Maven or Gradle or an IDE's builtin compiler?
  3. The jar is compiled via Maven. I use the same exact compiled jar both on my testing (localhost) server AND the hosted server.

    Example of an interaction I just had:
    - Reload server: No NPC
    - Reload server: NPC spawned in
    - Reload server: NPC spawned in again
    - Log off
    - Log in
    - NPC is gone
    <Repeat above getting weird results every-time I do anything>
  4. electronicboy

    IRC Staff

    NMS uses reflection in order to create an instance of an entity, you're missing a constructor which looks like ^ (I.e. has just a nms.World paramater)
    bearing in mind that if you log off and the chunk unloads, it needs to create an instance of that entity in the chunk via nms
    • Informative Informative x 1