diff options
author | Jason Penilla <[email protected]> | 2024-04-27 13:27:01 -0700 |
---|---|---|
committer | Jason Penilla <[email protected]> | 2024-04-27 13:27:01 -0700 |
commit | e2552eea2481871c9d8445a3c5653a2329112648 (patch) | |
tree | 727c90f395576b66200f8d9e59f38859f3850562 /patches/server/0542-Add-HiddenPotionEffect-API.patch | |
parent | 0b1b1fe067444c5e879313e017da0ffd5d6b826d (diff) | |
download | Paper-e2552eea2481871c9d8445a3c5653a2329112648.tar.gz Paper-e2552eea2481871c9d8445a3c5653a2329112648.zip |
Start cleaning up plugin remapping patches
Diffstat (limited to 'patches/server/0542-Add-HiddenPotionEffect-API.patch')
-rw-r--r-- | patches/server/0542-Add-HiddenPotionEffect-API.patch | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/patches/server/0542-Add-HiddenPotionEffect-API.patch b/patches/server/0542-Add-HiddenPotionEffect-API.patch new file mode 100644 index 0000000000..724bbc9ff5 --- /dev/null +++ b/patches/server/0542-Add-HiddenPotionEffect-API.patch @@ -0,0 +1,29 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Tamion <[email protected]> +Date: Sun, 5 Nov 2023 09:51:28 +0100 +Subject: [PATCH] Add HiddenPotionEffect API + +== AT == +public net.minecraft.world.effect.MobEffectInstance hiddenEffect + +diff --git a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java +index 068a9b2d7b6895f14077d9647a8c9fed3e3d3ade..14c58cf8d255c51473fd3d0092faeaf5a3c1ae0c 100644 +--- a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java ++++ b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java +@@ -10,6 +10,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 + } + +@@ -19,7 +20,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) { |