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.
This commit is contained in:
parent
b21eb4d9a4
commit
89d51d5f29
673 changed files with 157 additions and 189 deletions
29
patches/server/0553-Add-HiddenPotionEffect-API.patch
Normal file
29
patches/server/0553-Add-HiddenPotionEffect-API.patch
Normal file
|
@ -0,0 +1,29 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Tamion <70228790+notTamion@users.noreply.github.com>
|
||||
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 844fb8c662a409670f631228f687d85c5436d3dd..e938255fcc5db0c289d3e132175a541187e4a748 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java
|
||||
@@ -73,6 +73,7 @@ public class CraftPotionUtil {
|
||||
|
||||
public static MobEffectInstance fromBukkit(PotionEffect effect) {
|
||||
MobEffect type = CraftPotionEffectType.bukkitToMinecraft(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
|
||||
}
|
||||
|
||||
@@ -82,7 +83,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(MobEffect mobEffect, PotionEffectType type) {
|
Loading…
Add table
Add a link
Reference in a new issue