mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-17 05:41:26 +01:00
Add HiddenPotionEffect API
== AT == public net.minecraft.world.effect.MobEffectInstance hiddenEffect
This commit is contained in:
parent
556bc3e8b5
commit
c8c11363a0
@ -78,6 +78,7 @@ public class CraftPotionUtil {
|
|||||||
|
|
||||||
public static MobEffectInstance fromBukkit(PotionEffect effect) {
|
public static MobEffectInstance fromBukkit(PotionEffect effect) {
|
||||||
Holder<MobEffect> type = CraftPotionEffectType.bukkitToMinecraftHolder(effect.getType());
|
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
|
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();
|
int duration = effect.getDuration();
|
||||||
boolean ambient = effect.isAmbient();
|
boolean ambient = effect.isAmbient();
|
||||||
boolean particles = effect.isVisible();
|
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) {
|
public static boolean equals(Holder<MobEffect> mobEffect, PotionEffectType type) {
|
||||||
|
Loading…
Reference in New Issue
Block a user