public Collection<PotionEffect> getEffectsFromDamage(int damage) { if (cache.containsKey(damage)) return cache.get(damage); List<?> mcEffects = net.minecraft.server.PotionBrewer.getEffects(damage, false); List<PotionEffect> effects = new ArrayList<PotionEffect>(); if (mcEffects == null) return effects; for (Object raw : mcEffects) { if (raw == null || !(raw instanceof MobEffect)) continue; MobEffect mcEffect = (MobEffect) raw; PotionEffect effect = new PotionEffect(PotionEffectType.getById(mcEffect.getEffectId()), mcEffect.getDuration(), mcEffect.getAmplifier()); // Minecraft PotionBrewer applies duration modifiers automatically. effects.add(effect); } cache.put(damage, effects); return effects; }
public static PotionBrewer getBrewer() { return null; }
public static void setPotionBrewer(PotionBrewer other) { }