2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: MeFisto94 <MeFisto94@users.noreply.github.com>
|
|
|
|
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
|
2024-01-19 12:30:04 +01:00
|
|
|
index 1f245a40358309f2e71f473af6df8e71739e8082..2b8706dfccd263c2843dd8661a260536134ad3f8 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
2024-01-19 12:30:04 +01:00
|
|
|
@@ -4510,4 +4510,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
2021-06-11 14:02:28 +02:00
|
|
|
|
|
|
|
void accept(Entity entity, double x, double y, double z);
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // Paper start
|
|
|
|
+ public static int nextEntityId() {
|
|
|
|
+ return ENTITY_COUNTER.incrementAndGet();
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
2023-12-06 20:40:37 +01:00
|
|
|
index 2ff5d2c357a4832e2624ef53fb0110d61fddc6fc..88deea72f7456c178f54f6a245c84a64ffab6926 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
2023-12-06 04:00:14 +01:00
|
|
|
@@ -504,6 +504,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
2023-02-15 23:10:14 +01:00
|
|
|
Preconditions.checkArgument(dataVersion <= getDataVersion(), "Newer version! Server downgrades are not supported!");
|
|
|
|
return compound;
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
+
|
2023-02-15 23:10:14 +01:00
|
|
|
+ @Override
|
2021-06-11 14:02:28 +02:00
|
|
|
+ public int nextEntityId() {
|
|
|
|
+ return net.minecraft.world.entity.Entity.nextEntityId();
|
|
|
|
+ }
|
|
|
|
// Paper end
|
|
|
|
|
|
|
|
/**
|