aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0431-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch
diff options
context:
space:
mode:
authormaxcom1 <[email protected]>2024-03-23 22:26:17 +0100
committerGitHub <[email protected]>2024-03-23 17:26:17 -0400
commitb6001403e9703cadaa6e8c8558e732b91c3c6d6e (patch)
treea8c57bbc334a8ad48d4ad2b43db335667b142bee /patches/server/0431-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch
parent9ec7dfcbc41c6e625de0050b6997160a75df9f44 (diff)
downloadPaper-b6001403e9703cadaa6e8c8558e732b91c3c6d6e.tar.gz
Paper-b6001403e9703cadaa6e8c8558e732b91c3c6d6e.zip
Add methods to change entity physics (#10334)
Diffstat (limited to 'patches/server/0431-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch')
-rw-r--r--patches/server/0431-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/patches/server/0431-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch b/patches/server/0431-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch
new file mode 100644
index 0000000000..b01c302702
--- /dev/null
+++ b/patches/server/0431-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch
@@ -0,0 +1,38 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: MeFisto94 <[email protected]>
+Date: Fri, 28 Aug 2020 01:41:26 +0200
+Subject: [PATCH] Expose the Entity Counter to allow plugins to use valid and
+ non-conflicting Entity Ids
+
+
+diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
+index f45b148884b305628411d57f7662ea454fde3906..44610d4e3fb69e6cf5629d9e895e93d8dd5e09e9 100644
+--- a/src/main/java/net/minecraft/world/entity/Entity.java
++++ b/src/main/java/net/minecraft/world/entity/Entity.java
+@@ -4411,4 +4411,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+
+ void accept(Entity entity, double x, double y, double z);
+ }
++
++ // Paper start - Expose entity id counter
++ public static int nextEntityId() {
++ return ENTITY_COUNTER.incrementAndGet();
++ }
++ // Paper end - Expose entity id counter
+ }
+diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+index ef4b15e0ae11a54ec49e40f1d694dae58ae95e03..2bc3d9c02256269845d140764b7b1b201e38b569 100644
+--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
++++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+@@ -520,6 +520,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
+ Preconditions.checkArgument(dataVersion <= getDataVersion(), "Newer version! Server downgrades are not supported!");
+ return compound;
+ }
++
++ @Override
++ public int nextEntityId() {
++ return net.minecraft.world.entity.Entity.nextEntityId();
++ }
+ // Paper end
+
+ /**