Comments (7)
Solved. Will soon post a release with the fix.
from npclib.
Upon further research, the issue seems to be due to SlimeWorldManager as it creates a new World object ( example )
Not sure if this is something that is fixable on your end.
from npclib.
I've forked NPCLib and attempted to fix it.
Reflection.ConstructorInvoker entityArmorStandConstructor = null;
try{
System.out.println("Method 1 Attempt " + worldClass.getName());
entityArmorStandConstructor = (version.isAboveOrEqual(MinecraftVersion.V1_14_R1) ?
Reflection.getConstructor(ENTITY_ARMOR_STAND_CLAZZ, worldClass, double.class, double.class, double.class) :
Reflection.getConstructor(ENTITY_ARMOR_STAND_CLAZZ, worldClass));
System.out.println("Method 1");
}catch (Exception e){
System.out.println("Method 1 Failed");
try {
worldClass = worldClass.getSuperclass();
System.out.println("Method 2 Attempt " + worldClass.getName());
entityArmorStandConstructor = (version.isAboveOrEqual(MinecraftVersion.V1_14_R1) ?
Reflection.getConstructor(ENTITY_ARMOR_STAND_CLAZZ, worldClass, double.class, double.class, double.class) :
Reflection.getConstructor(ENTITY_ARMOR_STAND_CLAZZ, worldClass));
System.out.println("Method 2");
}catch (Exception e2){
System.out.println("Method 2 Failed");
if (Bukkit.getPluginManager().getPlugin("SlimeWorldManager") != null){
try {
worldClass = Reflection.getUntypedClass("com.grinderwolf.swm.nms." + NPCLib.getVersionName() + ".CustomWorldServer");
worldClass = worldClass.getSuperclass().getSuperclass();
System.out.println("Method 3 Attempt " + worldClass.getName());
entityArmorStandConstructor = (version.isAboveOrEqual(MinecraftVersion.V1_14_R1) ?
Reflection.getConstructor(ENTITY_ARMOR_STAND_CLAZZ, worldClass, double.class, double.class, double.class) :
Reflection.getConstructor(ENTITY_ARMOR_STAND_CLAZZ, worldClass));
System.out.println("Method 3");
}catch (Exception e3){
System.out.println("Failing silently... or not");
}
}
}
}
Using the above code I was able to get the NPCs' to spawn with SlimeWorldManager. The main portion of the code is getting the SuperClass of the WorldServer
object thats retrieved.
Reflection.ConstructorInvoker entityArmorStandConstructor = null;
try{
entityArmorStandConstructor = (version.isAboveOrEqual(MinecraftVersion.V1_14_R1) ?
Reflection.getConstructor(ENTITY_ARMOR_STAND_CLAZZ, worldClass, double.class, double.class, double.class) :
Reflection.getConstructor(ENTITY_ARMOR_STAND_CLAZZ, worldClass));
}catch (Exception e){
try {
worldClass = worldClass.getSuperclass();
entityArmorStandConstructor = (version.isAboveOrEqual(MinecraftVersion.V1_14_R1) ?
Reflection.getConstructor(ENTITY_ARMOR_STAND_CLAZZ, worldClass, double.class, double.class, double.class) :
Reflection.getConstructor(ENTITY_ARMOR_STAND_CLAZZ, worldClass));
}
Should fix the issue.
Now I'm getting a new issue with non 1.8 clients on a 1.8 server; they get kicked with an ArrayIndexOutOfBoundsException: 6
error. The same issue that #58 is getting
from npclib.
I'll see what I can do about this. With your fix it should be the same issue as found in #58.
Are you using any sort of server proxy? E.g. BungeeCord?
from npclib.
We're running Waterfall w/ ViaVersion on the Proxy & locally on the 1.8 servers.
If you go onto the server w/ a 1.8 client it works fine, but on any other version it crashes with that error. I don't know enough about packets to properly diagnose the issue myself
from npclib.
Issue #58 has been solved. I'll add your additions to the library so you can use your JDK of choice.
Hopefully I'll have an update posted by the end of the day.
from npclib.
https://github.com/JitseB/NPCLib/releases/tag/2.4.2-SNAPSHOT
from npclib.
Related Issues (20)
- Distant NPCs don't spawn when getting closer with ViaVersion HOT 2
- Custom AI for NPC?
- 1_16_R3 incompatible HOT 5
- HEX colors HOT 1
- NPC Movement HOT 2
- 1.17 support
- The NPC isn't configured to use skin overlays HOT 2
- Nullpointer when creating NPC HOT 1
- Replace Skin id by Skin uuid HOT 1
- discord for the people (link inside)
- Could not resolve dependencies
- Failed load the plugin HOT 1
- Fix NPC not fully loading if constructed when no players are online HOT 1
- Cannot invoke "net.jitse.npclib.api.NPC.setLocation()" because "npc" is null HOT 6
- NPC Rejoin Disappearance
- NPC save system HOT 2
- Exception in thread "pool-14-thread-2" java.lang.NullPointerException: "this.npcLib" is null" HOT 2
- Wrong README info HOT 1
- An opinion on skin HOT 1
- java.lang.ExceptionInInitializerError
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from npclib.