mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-31 20:22:05 -07:00
Merge branch 'master' into pre/1.13
* master: Duplicate UUID Resolve Option Add more information to Entity.toString change LAST_EDIT to PAPER_LAST_EDIT for edit commands Add more information to Entity.toString() Add Debug Entities option to debug dupe uuid issues Guard the Entity.SHARED_RANDOM from seed changes Create a symlink on not-windows to current minecraft decompile dir
This commit is contained in:
@@ -13,7 +13,20 @@ index e16579116..c0367df20 100644
|
||||
|
||||
// CraftBukkit start
|
||||
private static final int CURRENT_LEVEL = 2;
|
||||
+ public static Random SHARED_RANDOM = new Random(); // Paper
|
||||
+ // Paper start
|
||||
+ public static Random SHARED_RANDOM = new Random() {
|
||||
+ private boolean locked = false;
|
||||
+ @Override
|
||||
+ public synchronized void setSeed(long seed) {
|
||||
+ if (locked) {
|
||||
+ LogManager.getLogger().error("Ignoring setSeed on Entity.SHARED_RANDOM", new Throwable());
|
||||
+ } else {
|
||||
+ super.setSeed(seed);
|
||||
+ locked = true;
|
||||
+ }
|
||||
+ }
|
||||
+ };
|
||||
+ // Paper end
|
||||
static boolean isLevelAtLeast(NBTTagCompound tag, int level) {
|
||||
return tag.hasKey("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level;
|
||||
}
|
||||
|
Reference in New Issue
Block a user