Fix PotionAPI ignores icon flag (#9864)

* fix PotionAPI ignores icon flag

* also fix CraftPotionUtil#toBukkit

* also CraftPotionUtil#fromBukkit

* use CraftPotionUtil
This commit is contained in:
Tamion
2023-10-29 00:39:47 +02:00
parent 9db92731a1
commit 8222e33a11
2 changed files with 43 additions and 2 deletions

View File

@@ -174,7 +174,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override
public boolean addPotionEffect(PotionEffect effect, boolean force) {
+ org.spigotmc.AsyncCatcher.catchOp("effect add"); // Paper
this.getHandle().addEffect(new MobEffectInstance(CraftPotionEffectType.bukkitToMinecraft(effect.getType()), effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles(), effect.hasIcon()), EntityPotionEffectEvent.Cause.PLUGIN); // Paper - Don't ignore icon
this.getHandle().addEffect(CraftPotionUtil.fromBukkit(effect), EntityPotionEffectEvent.Cause.PLUGIN); // Paper - Don't ignore icon
return true;
}
diff --git a/src/main/java/org/spigotmc/AsyncCatcher.java b/src/main/java/org/spigotmc/AsyncCatcher.java