2020-08-27 23:44:21 +00: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
|
|
|
|
|
|
|
|
|
2021-03-16 07:19:45 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
2021-03-16 13:04:28 +00:00
|
|
|
index 0a853ffc658d8e82c21af7853bdaa9112a4e1e20..1b3371b087efa8c184f3c07fe560a709f76db4f7 100644
|
2021-03-16 07:19:45 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
2021-03-16 13:04:28 +00:00
|
|
|
@@ -3473,4 +3473,10 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
|
2020-08-27 23:44:21 +00:00
|
|
|
|
|
|
|
void accept(Entity entity, double d0, double d1, double d2);
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // Paper start
|
|
|
|
+ public static int nextEntityId() {
|
|
|
|
+ return entityCount.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
|
2021-03-16 07:19:45 +00:00
|
|
|
index 6fbface979f6f9ed97bb39ca91a29bffe05fddda..25af57d0ab191f6a29ae95cec764667e9c23bdd4 100644
|
2020-08-27 23:44:21 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
2021-03-09 01:11:17 +00:00
|
|
|
@@ -420,6 +420,10 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
2021-03-16 07:19:45 +00:00
|
|
|
return net.minecraft.world.entity.EntityTypes.getByName(type.getName()).map(net.minecraft.world.entity.EntityTypes::getDescriptionId).orElse(null);
|
2020-08-27 23:44:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ public int nextEntityId() {
|
2021-03-16 07:19:45 +00:00
|
|
|
+ return net.minecraft.world.entity.Entity.nextEntityId();
|
2020-08-27 23:44:21 +00:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
// Paper end
|
|
|
|
|
|
|
|
/**
|