SPIGOT-4900: Rearchitect multiworld support for better compat with new villager AI

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2019-05-12 11:15:48 +10:00
parent 8b207fdf78
commit b407bebd8d
22 changed files with 208 additions and 227 deletions

View File

@@ -55,9 +55,9 @@
+ if (world == null) {
+ /* All Maps which do not have their valid world loaded are set to a dimension which hopefully won't be reached.
+ This is to prevent them being corrupted with the wrong map data. */
+ this.map = new DimensionManager(127, null, null, null, false);
+ this.map = new DimensionManager(127, null, null, null, false, DimensionManager.OVERWORLD);
+ } else {
+ this.map = world.getHandle().dimension;
+ this.map = world.getHandle().getWorldProvider().getDimensionManager();
+ }
+ }
+ } else {
@@ -77,7 +77,7 @@
+ if (this.uniqueId == null) {
+ for (org.bukkit.World world : server.getWorlds()) {
+ CraftWorld cWorld = (CraftWorld) world;
+ if (cWorld.getHandle().dimension == this.map) {
+ if (cWorld.getHandle().getWorldProvider().getDimensionManager() == this.map) {
+ this.uniqueId = cWorld.getUID();
+ break;
+ }