ProtocolLib

3M Downloads

1.17 - PotionEffectType error "Unable to find method fromId"

LoneDev6 opened this issue ยท 2 comments

commented
java.lang.IllegalArgumentException: Unable to find method fromId ([int]) in class net.minecraft.world.effect.MobEffectList.
        at com.comphenix.protocol.reflect.ExactReflection.getMethod(ExactReflection.java:87) ~[?:?]
        at com.comphenix.protocol.reflect.ExactReflection.getMethod(ExactReflection.java:86) ~[?:?]
        at com.comphenix.protocol.reflect.ExactReflection.getMethod(ExactReflection.java:70) ~[?:?]
        at com.comphenix.protocol.reflect.accessors.Accessors.getMethodAccessor(Accessors.java:243) ~[?:?]
        at com.comphenix.protocol.wrappers.BukkitConverters$20.getGeneric(BukkitConverters.java:1211) ~[?:?]
        at com.comphenix.protocol.wrappers.BukkitConverters$20.getGeneric(BukkitConverters.java:1200) ~[?:?]
        at com.comphenix.protocol.wrappers.Converters$1.getGeneric(Converters.java:47) ~[?:?]
        at com.comphenix.protocol.reflect.StructureModifier.writeInternal(StructureModifier.java:372) ~[?:?]
        at com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:345) ~[?:?]

Code:

PacketContainer container = new PacketContainer(PacketType.Play.Server.REMOVE_ENTITY_EFFECT);
        container.getIntegers().write(0, player.getEntityId());
        container.getEffectTypes().write(0, PotionEffectType.SLOW_DIGGING); // <---- exception here

This server is running Paper version git-Paper-"10e9c5a" (MC: 1.17) (Implementing API version 1.17-R0.1-SNAPSHOT)

ProtocolLib version 4.7.0-SNAPSHOT-b520

commented

On normal Spigot seems to work fine, only Paper is affected.

Spigot MobEffectList:

    public static MobEffectList byId(int rawId) {
        return (MobEffectList)IRegistry.V.fromId(rawId);// 37
    }

Paper MobEffectList:

    public static MobEffectList fromId(int i) {
        return (MobEffectList)IRegistry.V.fromId(i);// 39
    }
commented

@LoneDev6 should be fixed in the latest dev build