Causes NoClassDefFoundError with WrappedAttributeModifier
tomocrafter opened this issue ยท 2 comments
Make sure you're doing the following
- You're using the latest build for your server version
- This isn't an issue caused by another plugin
- You've checked for duplicate issues
- You didn't use
/reload
Describe the question
Currently I am using:
- Spigot:
This server is running CraftBukkit version git-Spigot-db6de12-18fbb24 (MC: 1.8.8) (Implementing API version 1.8.8-R0.1-SNAPSHOT)
- ProtocolLib: 4.5.0
- ProtocolLib API (Gradle): 4.5.0 with official repository
It loads properly but when I joined to the server, it prints some errors on my screen.
and I tried to decompile ProtocolLib and check if there is no com.comphenix.protocol.wrappers.WrappedAttributeModifier
class defined. but I found it correctly.
Calls
// event is PacketEvent which is received as argument on "onPacketSending"
ArrayList<WrappedAttribute>(event.packet.attributeCollectionModifier.read(0))
causes
java.lang.NoClassDefFoundError: Could not initialize class com.comphenix.protocol.wrappers.WrappedAttributeModifier
at com.comphenix.protocol.wrappers.WrappedAttribute$1.toOuter(WrappedAttribute.java:173) ~[?:?]
at com.comphenix.protocol.wrappers.WrappedAttribute$1.toOuter(WrappedAttribute.java:165) ~[?:?]
at com.comphenix.protocol.wrappers.collection.AbstractConverted$2.apply(AbstractConverted.java:45) ~[?:?]
at com.google.common.collect.Iterators$8.transform(Iterators.java:794) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
at com.comphenix.protocol.wrappers.collection.CachedCollection$1.getSourceValue(CachedCollection.java:116) ~[?:?]
at com.comphenix.protocol.wrappers.collection.CachedCollection$1.next(CachedCollection.java:96) ~[?:?]
at com.google.common.collect.Iterators.size(Iterators.java:187) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
at com.comphenix.protocol.wrappers.collection.CachedCollection.toArray(CachedCollection.java:125) ~[ProtocolLib.jar:4.5.0]
at java.base/java.util.Collections$UnmodifiableCollection.toArray(Collections.java:1037) ~[?:?]
at java.base/java.util.ArrayList.<init>(ArrayList.java:179) ~[?:?]
API method(s) used
- PacketContainer#getAttributeCollectionModifier#read
Expected behavior
Correctly can be converted to MutableList(ArrayList)