JitseB / NPCLib

(Minecraft) NPCLib – Basic non-player character library.
MIT License
197 stars 49 forks source link

Can't shade NPCLib #144

Closed stijnb1234 closed 3 years ago

stijnb1234 commented 3 years ago

Describe the bug You can't shade NPCLib, because of this detection:

try {
            npcClass = Class.forName("net.jitse.npclib.nms." + versionName + ".NPC_" + versionName);
        } catch (ClassNotFoundException exception) {
            // Version not supported, error below.
        }

The package will be changed when you shade it into your own plugin, so it doesn't detect the version.

NPCLib usage option I'm Repacking the library.

NPCLib JAR name Nvt

Server version Paper version git-Paper-434 (MC: 1.16.5)

To Reproduce

  1. Start plugin with NPCLib shaded into it.
  2. See error.

Expected behavior It should just work.

Chibilena commented 3 years ago

It works for me without any problems. Which one do you use the API or the plugin version?

JitseB commented 3 years ago

There is no need to repackage it into your own package. However I know why you'd want to do this, but I'm yet to come up with a better solution.

stijnb1234 commented 3 years ago

There is no need to repackage it into your own package. However I know why you'd want to do this, but I'm yet to come up with a better solution.

Ah, okay. I've fixed it for now by putting the plugin jar into my server, and changing the scope to "provided".

Maybe you can build a list of supported versions and check if it's included in that list?

JitseB commented 3 years ago

Yep, that’s one way to fix it.

What do you mean by building a list of supported versions? Versions of what?

stijnb1234 commented 3 years ago

Yep, that’s one way to fix it.

What do you mean by building a list of supported versions? Versions of what?

NMS versions

JitseB commented 3 years ago

All NMS versions between 1.8 R3 and the latest MC release are supported by NPCLib.

JitseB commented 3 years ago

Closing issue, no activity.