mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 17:07:43 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@996d529 Resend entity using the bundle packet (#9853) PaperMC/Paper@8cf2503 Updated Upstream (Bukkit/CraftBukkit) (#9876) PaperMC/Paper@2935067 Fix null item in sendEquipmentChange (#9869) PaperMC/Paper@b3cac04 Fix crash when version_history.json is empty (#9871) PaperMC/Paper@b1faa5d Fix PotionAPI ignores icon flag (#9864) PaperMC/Paper@52849f6 Cleanup disable explosion knockback patch (#9858) PaperMC/Paper@8b1ac39 Fix warden spawn reason from DEFAULT to NATURAL (#8744) PaperMC/Paper@c6fac38 fix UnsafeValues#loadAdvancement doesn't recalculate position (#9846) PaperMC/Paper@5bdfb29 Add player idle duration API (#9833) PaperMC/Paper@a81a384 Implement Velocity VarInt optimizations (#8418) PaperMC/Paper@415d708 [ci skip] Fix author in last patch PaperMC/Paper@3e4eaf2 [ci skip] Fix module derp PaperMC/Paper@5bb30ce Fix entity camera not being reset when cancelling spectating start/stop events (#9883) PaperMC/Paper@1865625 Fix NPE when no valid world is found on legacy Players (#9885)
This commit is contained in:
@@ -160,36 +160,18 @@ index 68e1b8271475996020af50b3b2cf04cd25aa6c85..4f2fcbcf90d6f5ee89e35c993a65cae6
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index a86ce1e672df969b28293e7da4c6f4414d8d80a7..bc2a7120a7758097080b39f2aa37828d98b84fd5 100644
|
||||
index 7feff1402b3034d0f387440f28ee7a71e4ff4acf..3741993bfdf6b356619d04296c16cf2d2018e091 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -465,7 +465,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@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
|
||||
+ this.getHandle().addEffect(new MobEffectInstance(CraftPotionEffectType.bukkitToMinecraft(effect.getType()), effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles(), effect.hasIcon(), effect.getKey()), EntityPotionEffectEvent.Cause.PLUGIN); // Purpur - add key // Paper - Don't ignore icon
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -486,7 +486,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@Override
|
||||
public PotionEffect getPotionEffect(PotionEffectType type) {
|
||||
MobEffectInstance handle = this.getHandle().getEffect(CraftPotionEffectType.bukkitToMinecraft(type));
|
||||
- return (handle == null) ? null : new PotionEffect(CraftPotionEffectType.minecraftToBukkit(handle.getEffect()), handle.getDuration(), handle.getAmplifier(), handle.isAmbient(), handle.isVisible());
|
||||
+ return (handle == null) ? null : new PotionEffect(CraftPotionEffectType.minecraftToBukkit(handle.getEffect()), handle.getDuration(), handle.getAmplifier(), handle.isAmbient(), handle.isVisible(), handle.getKey()); // Purpur - add key
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -498,7 +498,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
public Collection<PotionEffect> getActivePotionEffects() {
|
||||
List<PotionEffect> effects = new ArrayList<PotionEffect>();
|
||||
for (MobEffectInstance handle : this.getHandle().activeEffects.values()) {
|
||||
- effects.add(new PotionEffect(CraftPotionEffectType.minecraftToBukkit(handle.getEffect()), handle.getDuration(), handle.getAmplifier(), handle.isAmbient(), handle.isVisible()));
|
||||
+ effects.add(new PotionEffect(CraftPotionEffectType.minecraftToBukkit(handle.getEffect()), handle.getDuration(), handle.getAmplifier(), handle.isAmbient(), handle.isVisible(), handle.getKey())); // Purpur - add key
|
||||
}
|
||||
return effects;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java
|
||||
index bac3a5c378054481e1a5abaec1f83afde5d64ac1..f1050bf2b9efc54a894426b08989d44566acd875 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java
|
||||
@@ -239,15 +221,15 @@ index bac3a5c378054481e1a5abaec1f83afde5d64ac1..f1050bf2b9efc54a894426b08989d445
|
||||
}
|
||||
this.customEffects.set(index, effect);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java
|
||||
index e29679a92da5ec05e122bb972a5ee469059a7a0a..70a3463eb6c93b662c5858016f934aa9ab267397 100644
|
||||
index 844fb8c662a409670f631228f687d85c5436d3dd..2bfa5908f1848702ceb42da7576a609d0928eddd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java
|
||||
@@ -73,7 +73,7 @@ public class CraftPotionUtil {
|
||||
|
||||
public static MobEffectInstance fromBukkit(PotionEffect effect) {
|
||||
MobEffect type = CraftPotionEffectType.bukkitToMinecraft(effect.getType());
|
||||
- return new MobEffectInstance(type, effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles());
|
||||
+ return new MobEffectInstance(type, effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles(), effect.getKey()); // Purpur - add key
|
||||
- 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(), effect.getKey()); // Paper // Purpur - add key
|
||||
}
|
||||
|
||||
public static PotionEffect toBukkit(MobEffectInstance effect) {
|
||||
@@ -255,8 +237,8 @@ index e29679a92da5ec05e122bb972a5ee469059a7a0a..70a3463eb6c93b662c5858016f934aa9
|
||||
int duration = effect.getDuration();
|
||||
boolean ambient = effect.isAmbient();
|
||||
boolean particles = effect.isVisible();
|
||||
- return new PotionEffect(type, duration, amp, ambient, particles);
|
||||
+ return new PotionEffect(type, duration, amp, ambient, particles, effect.getKey()); // Purpur - add key
|
||||
- return new PotionEffect(type, duration, amp, ambient, particles, effect.showIcon()); // Paper
|
||||
+ return new PotionEffect(type, duration, amp, ambient, particles, effect.showIcon(), effect.getKey()); // Paper // Purpur - add key
|
||||
}
|
||||
|
||||
public static boolean equals(MobEffect mobEffect, PotionEffectType type) {
|
||||
|
||||
Reference in New Issue
Block a user