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: https://github.com/SirLich/spigot-prison

    The issues look like this:
    Code (Text):

    [21:16:46] [Server thread/WARN]: java.lang.NoSuchMethodException: main.me.sirlich.Prison.civilians.Civilian.<init>(net.minecraft.server.v1_12_R1.World)
    [21:16:46] [Server thread/WARN]:     at java.lang.Class.getConstructor0(Class.java:3082)
    [21:16:46] [Server thread/WARN]:     at java.lang.Class.getConstructor(Class.java:1825)
    [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(ChunkRegionLoader.java:532)
    [21:16:46] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.ChunkRegionLoader.a(ChunkRegionLoader.java:473)
    [21:16:46] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.ChunkRegionLoader.loadEntities(ChunkRegionLoader.java:432)
    [21:16:46] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:42)
    [21:16:46] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:1)
    [21:16:46] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_12_R1.util.AsynchronousExecutor$Task.finish(AsynchronousExecutor.java:188)
    [21:16:46] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_12_R1.util.AsynchronousExecutor.finishActive(AsynchronousExecutor.java:347)
    [21:16:46] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOExecutor.tick(ChunkIOExecutor.java:34)
    [21:16:46] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:763)
    [21:16:46] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406)
    [21:16:46] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679)
    [21:16:46] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577)
    [21:16:46] [Server thread/WARN]:     at java.lang.Thread.run(Thread.java:748)
    [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
    ~Lich
     
  2. ScarabCoder

    ScarabCoder Retired Resource Staff
    Retired

    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