mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-31 20:22:05 -07:00
More progress
This commit is contained in:
@@ -6,13 +6,13 @@ Subject: [PATCH] Use a Shared Random for Entities
|
||||
Reduces memory usage and provides ensures more randomness, Especially since a lot of garbage entity objects get created.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 39ca7d5870..865dfa2b05 100644
|
||||
index 2e5426432..167d22574 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
return tag.hasKey("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level;
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
private static final int CURRENT_LEVEL = 2;
|
||||
+ // Paper start
|
||||
+ public static Random SHARED_RANDOM = new Random() {
|
||||
+ private boolean locked = false;
|
||||
@@ -27,11 +27,12 @@ index 39ca7d5870..865dfa2b05 100644
|
||||
+ }
|
||||
+ };
|
||||
+ // Paper end
|
||||
static boolean isLevelAtLeast(NBTTagCompound tag, int level) {
|
||||
return tag.hasKey("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level;
|
||||
}
|
||||
+
|
||||
private CraftEntity bukkitEntity;
|
||||
|
||||
public CraftEntity getBukkitEntity() {
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
this.B = Vec3D.a;
|
||||
this.y = Vec3D.a;
|
||||
this.av = 1.0F;
|
||||
this.aw = 1.0F;
|
||||
- this.random = new Random();
|
||||
|
Reference in New Issue
Block a user