2020-08-28 07:44:21 +08: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 15:19:45 +08: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-17 00:37:33 +08:00
|
|
|
index 344862c3f479ae7b6d4f929c9ef7882aba983ffb..e2301dbeb3d76684b2a0ab4262bb76cab3557789 100644
|
2021-03-16 15:19:45 +08:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
2021-03-16 21:04:28 +08:00
|
|
|
@@ -3473,4 +3473,10 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
|
2020-08-28 07:44:21 +08: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-05-12 19:12:28 +08:00
|
|
|
index 8049063ea37f3e0eac3f3a26703adc80fc99341a..5b03187f4d76e3052ee9abe0ee2774218d41b864 100644
|
2020-08-28 07:44:21 +08:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
2021-05-12 19:12:28 +08:00
|
|
|
@@ -445,6 +445,10 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
|
|
|
net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(itemStack);
|
|
|
|
return nmsItemStack.getItem().getDescriptionId(nmsItemStack);
|
2020-08-28 07:44:21 +08:00
|
|
|
}
|
2021-05-12 19:12:28 +08:00
|
|
|
+
|
2020-08-28 07:44:21 +08:00
|
|
|
+ public int nextEntityId() {
|
2021-03-16 15:19:45 +08:00
|
|
|
+ return net.minecraft.world.entity.Entity.nextEntityId();
|
2020-08-28 07:44:21 +08:00
|
|
|
+ }
|
|
|
|
// Paper end
|
|
|
|
|
|
|
|
/**
|