Paper/patches/server/0877-Add-method-to-remove-all-active-potion-effects.patch
Owen 89d51d5f29
Allow enabling sand duping (#10191)
Because this exploit has been widely known for years and has not been fixed by Mojang, we decided that it was worth allowing people to toggle it on/off due to how easy it is to make it configurable.

It should be noted that this decision does not promise all future exploits will be configurable.
2024-03-03 17:05:34 -05:00

25 lines
1.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Sat, 17 Jun 2023 13:17:25 -0700
Subject: [PATCH] Add method to remove all active potion effects
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 3302d8e9b7c2c48b20dd257f4699b263d3bc52dc..3f952d1409118535f325f614f1a6507c40efa4d6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -540,6 +540,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
return effects;
}
+ // Paper start - LivingEntity#clearActivePotionEffects();
+ @Override
+ public boolean clearActivePotionEffects() {
+ return this.getHandle().removeAllEffects(EntityPotionEffectEvent.Cause.PLUGIN);
+ }
+ // Paper end
+
@Override
public <T extends Projectile> T launchProjectile(Class<? extends T> projectile) {
return this.launchProjectile(projectile, null);