More progress

This commit is contained in:
Zach Brown
2019-12-10 20:43:21 -06:00
parent 0d64f85acc
commit 2dc2fcce09
43 changed files with 260 additions and 452 deletions

View File

@@ -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();