Search in sources :

Example 1 with ConverterMethod

use of com.bergerkiller.mountiplex.conversion.annotations.ConverterMethod in project BKCommonLib by bergerhealer.

the class WrapperConversion method toPotionEffectType.

@SuppressWarnings("deprecation")
@ConverterMethod(input = "net.minecraft.server.MobEffectList")
public static PotionEffectType toPotionEffectType(Object nmsMobEffectListHandle) {
    int id = NMSMobEffect.List.getId.invoke(null, nmsMobEffectListHandle);
    PotionEffectType type = PotionEffectType.getById(id);
    if (type != null) {
        return type;
    } else {
        return null;
    }
}
Also used : PotionEffectType(org.bukkit.potion.PotionEffectType) ConverterMethod(com.bergerkiller.mountiplex.conversion.annotations.ConverterMethod)

Aggregations

ConverterMethod (com.bergerkiller.mountiplex.conversion.annotations.ConverterMethod)1 PotionEffectType (org.bukkit.potion.PotionEffectType)1