aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0734-Entity-powdered-snow-API.patch
diff options
context:
space:
mode:
authorNassim Jahnke <[email protected]>2023-09-23 11:45:34 +1000
committerNassim Jahnke <[email protected]>2023-09-23 11:45:34 +1000
commita353f4d207994e0f2dfe55047cffbcb98f74bafc (patch)
treed16ee406ab9cd0d19c35f1c318d59e28c23cf6d6 /patches/server/0734-Entity-powdered-snow-API.patch
parenta50d7c340b9922eab16fd9f246269b4c75453648 (diff)
downloadPaper-a353f4d207994e0f2dfe55047cffbcb98f74bafc.tar.gz
Paper-a353f4d207994e0f2dfe55047cffbcb98f74bafc.zip
Readd network optimization patch
Diffstat (limited to 'patches/server/0734-Entity-powdered-snow-API.patch')
-rw-r--r--patches/server/0734-Entity-powdered-snow-API.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/patches/server/0734-Entity-powdered-snow-API.patch b/patches/server/0734-Entity-powdered-snow-API.patch
new file mode 100644
index 0000000000..2ef1f74e6b
--- /dev/null
+++ b/patches/server/0734-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 984e6fa489e6b3d833d5f83dd739a6ff8a3ec5f0..f05d8107368e639adf60f3e5d944c65300087a3c 100644
+--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+@@ -1381,5 +1381,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 956ddd955e6f9b2f02ef05b0e95150c9c90c3107..16e6325a944c1eb21dd5a3835aa8a00d238e7b5d 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
+ }