Discussion in 'Spigot Plugin Development' started by TheBlackTeddy, Apr 18, 2017.

    #1 TheBlackTeddy, Apr 18, 2017
    Last edited: Jan 22, 2021
  2. You're most likely using the spigot-api jar, which doesn't include NMS (actual server code). You'll need to add the spigot server jar as a dependancy but be warned that this will make your plugin only compatible with that version unless you either use version wrappers or reflection.
  3. I'm not completely sure what you mean by
    Do you mean you're unable to import the class?
  4. Still not very descriptive of your situation. Try typing NetLoginHandler and seeing if you can auto-import. Also, to assist me, try describing what outcome you want so I can more easily determine what's your issue.
  5. You'll need to decompile spigot in order to see the class for your version and be able to use reflection. I'm afraid I can't assist you further until you have your own code that you've written.
  6. Your class "me.TheBlackTeddy.MysteryMCCore.LoginListener" must extend the class "net.minecraft.server.v1_8_R3.LoginListener". Override all relevant methods.
  7. Works fine for me:
    Code (Java):
    import net.minecraft.server.v1_8_R3.MinecraftServer;
    import net.minecraft.server.v1_8_R3.NetworkManager;
    private class LoginListener extends net.minecraft.server.v1_8_R3.LoginListener {
        public LoginListener(MinecraftServer minecraftserver, NetworkManager networkmanager) {
            super(minecraftserver, networkmanager);
    EDIT: Fixed typo & added imports.
  8. @TheBlackTeddy what on earth are you attempting to do? Also, NetLoginHandler is quite old I believe (I'd say before the netty rewrite, so before mc 1.7) so the info you used is quite dated. It could also be from mcp, but I'm not sure.
    • Informative Informative x 1
  9. You forgot
    Your constuctor must call the parent constructor.

    That's an exellent question. Be aware of the XY problem.
  10. I guess so. Declaring a new class doesn't do anything. Look up, where NMS instantiates his LoginListener and how it registers it (e.g. use the call hierarchy).
  11. upload_2017-4-18_21-21-2.png
    In case of 1.10.2:
    Have a closer look at "net.minecraft.server.NetworkManager#setPacketListener"

    However i think it's highly critical to hook into NMS this way. I do not recomment it.

    You better should have a closer look at netty channels & pipelines of new player connections.
    Registering a new netty channel decoder is way more safe, easier, stable,... and recommended, rather than doing stuff like Overriding NMS methods by extending their classes.
  12. Now stop what you're doing. I'm not sure if you're aware of what you're currently doing, but I can tell you that you really shouldn't be doing this. You can listen for the AsyncPlayerPreLoginEvent and do whatever you want with the UUID and IP
  13. You're one hilarious person.
  14. Are those normal premium accounts with leaked passwords?
    How do you want to recognize those accounts?
    By their UUID? If so, just listen to the Bukkit LoginEvent?
  15. Using a modded client?
    So i guess it's a single premium uuid and those clients share it internally.
    #15 Michel_0, Apr 18, 2017
    Last edited: Apr 18, 2017
  16. [​IMG]