13
0
geforkt von Mirrors/Paper

Add HiddenPotionEffect API

== AT ==
public net.minecraft.world.effect.MobEffectInstance hiddenEffect
Dieser Commit ist enthalten in:
Tamion 2023-11-05 09:51:28 +01:00
Ursprung 556bc3e8b5
Commit c8c11363a0

Datei anzeigen

@ -78,6 +78,7 @@ public class CraftPotionUtil {
public static MobEffectInstance fromBukkit(PotionEffect effect) {
Holder<MobEffect> type = CraftPotionEffectType.bukkitToMinecraftHolder(effect.getType());
// Paper - Note: do not copy over the hidden effect, as this method is only used for applying to entities which we do not want to convert over.
return new MobEffectInstance(type, effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles(), effect.hasIcon()); // Paper
}
@ -87,7 +88,7 @@ public class CraftPotionUtil {
int duration = effect.getDuration();
boolean ambient = effect.isAmbient();
boolean particles = effect.isVisible();
return new PotionEffect(type, duration, amp, ambient, particles, effect.showIcon()); // Paper
return new PotionEffect(type, duration, amp, ambient, particles, effect.showIcon(), effect.hiddenEffect == null ? null : toBukkit(effect.hiddenEffect)); // Paper
}
public static boolean equals(Holder<MobEffect> mobEffect, PotionEffectType type) {