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:
Aikar
2018-07-21 16:13:27 -04:00
9 changed files with 385 additions and 27 deletions

View File

@@ -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;
}