aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0677-Entity-powdered-snow-API.patch
diff options
context:
space:
mode:
authorOwen <[email protected]>2024-03-03 17:05:34 -0500
committerGitHub <[email protected]>2024-03-03 17:05:34 -0500
commit89d51d5f298cd25d6f44388970596c6780b5664b (patch)
tree07f41f4ce7bc466ea5e35faa2575d0ec6f6c4a76 /patches/server/0677-Entity-powdered-snow-API.patch
parentb21eb4d9a4d0d0bea857675e2186657592df548e (diff)
downloadPaper-89d51d5f298cd25d6f44388970596c6780b5664b.tar.gz
Paper-89d51d5f298cd25d6f44388970596c6780b5664b.zip
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.
Diffstat (limited to 'patches/server/0677-Entity-powdered-snow-API.patch')
-rw-r--r--patches/server/0677-Entity-powdered-snow-API.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/patches/server/0677-Entity-powdered-snow-API.patch b/patches/server/0677-Entity-powdered-snow-API.patch
new file mode 100644
index 0000000000..9976726fc5
--- /dev/null
+++ b/patches/server/0677-Entity-powdered-snow-API.patch
@@ -0,0 +1,39 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jake Potrebic <[email protected]>
+Date: Sun, 24 Oct 2021 20:58:43 -0700
+Subject: [PATCH] Entity powdered snow API
+
+== AT ==
+public net.minecraft.world.entity.monster.Skeleton inPowderSnowTime
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+index 411e2eed16d5b774900fc12f5ad782ab229dde97..71f9b7bbbabae9291fdb9f902f3f69c13e715c0e 100644
+--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+@@ -1087,5 +1087,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
+ this.entity.setRot(location.getYaw(), location.getPitch());
+ return !this.entity.valid && this.entity.level().addFreshEntity(this.entity, reason);
+ }
++
++ @Override
++ public boolean isInPowderedSnow() {
++ return getHandle().isInPowderSnow || getHandle().wasInPowderSnow; // depending on the location in the entity "tick" either could be needed.
++ }
+ // Paper end
+ }
+diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java
+index a0ea54181de6c6685deef265cbe9f66aabbca42b..6f98da9be6aef35e3b5c940188b872459a383c8e 100644
+--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java
++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java
+@@ -45,4 +45,11 @@ public class CraftSkeleton extends CraftAbstractSkeleton implements Skeleton {
+ public SkeletonType getSkeletonType() {
+ return SkeletonType.NORMAL;
+ }
++
++ // Paper start
++ @Override
++ public int inPowderedSnowTime() {
++ return getHandle().inPowderSnowTime;
++ }
++ // Paper end
+ }