MinecraftUtils.java 文件源码

java
阅读 30 收藏 0 点赞 0 评论 0

项目:VanillaPlus 作者:
public static PotionEffect craftPotionEffect(String name, ConfigurationSection section) {
    if(section == null){
        Error.MISSING.add();
        return null;
    }
    PotionEffectType effect = PotionEffectType.getByName(name);
    if( effect == null ) {
        ErrorLogger.addError(name + " is not a valid potion effect type !");
        return null;
    }
    int duration = section.getInt(Node.DURATION.get(), 120)*20;
    int amplifier = section.getInt(Node.LEVEL.get(), 1) - 1;
    boolean ambient = section.getBoolean(Node.AMBIANT.get(), true);
    boolean particles = section.getBoolean(Node.PARTICLE.get(), true);
    return new PotionEffect(effect, duration, amplifier, ambient, particles);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号