13
0
geforkt von Mirrors/Paper

SPIGOT-3899: Only load advancements from primary world

By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2018-04-15 10:21:11 +10:00
Ursprung d54b9c77e9
Commit e6acb81bea

Datei anzeigen

@ -63,7 +63,7 @@
this.scoreboard = new ScoreboardServer(this.server); this.scoreboard = new ScoreboardServer(this.server);
PersistentScoreboard persistentscoreboard = (PersistentScoreboard) this.worldMaps.get(PersistentScoreboard.class, "scoreboard"); PersistentScoreboard persistentscoreboard = (PersistentScoreboard) this.worldMaps.get(PersistentScoreboard.class, "scoreboard");
@@ -75,9 +96,21 @@ @@ -75,9 +96,24 @@
persistentscoreboard.a(this.scoreboard); persistentscoreboard.a(this.scoreboard);
((ScoreboardServer) this.scoreboard).a((Runnable) (new RunnableSaveScoreboard(persistentscoreboard))); ((ScoreboardServer) this.scoreboard).a((Runnable) (new RunnableSaveScoreboard(persistentscoreboard)));
@ -77,6 +77,9 @@
- this.C = new AdvancementDataWorld(new File(new File(this.dataManager.getDirectory(), "data"), "advancements")); - this.C = new AdvancementDataWorld(new File(new File(this.dataManager.getDirectory(), "data"), "advancements"));
- this.D = new CustomFunctionData(new File(new File(this.dataManager.getDirectory(), "data"), "functions"), this.server); - this.D = new CustomFunctionData(new File(new File(this.dataManager.getDirectory(), "data"), "functions"), this.server);
+ // CraftBukkit start + // CraftBukkit start
+ if (this.dimension != 0) { // SPIGOT-3899 multiple worlds of advancements not supported
+ this.C = this.server.getAdvancementData();
+ }
+ if (this.C == null) { + if (this.C == null) {
+ this.C = new AdvancementDataWorld(new File(new File(this.dataManager.getDirectory(), "data"), "advancements")); + this.C = new AdvancementDataWorld(new File(new File(this.dataManager.getDirectory(), "data"), "advancements"));
+ } + }
@ -87,7 +90,7 @@
this.getWorldBorder().setCenter(this.worldData.B(), this.worldData.C()); this.getWorldBorder().setCenter(this.worldData.B(), this.worldData.C());
this.getWorldBorder().setDamageAmount(this.worldData.H()); this.getWorldBorder().setDamageAmount(this.worldData.H());
this.getWorldBorder().setDamageBuffer(this.worldData.G()); this.getWorldBorder().setDamageBuffer(this.worldData.G());
@@ -89,9 +122,146 @@ @@ -89,9 +125,146 @@
this.getWorldBorder().setSize(this.worldData.D()); this.getWorldBorder().setSize(this.worldData.D());
} }
@ -234,7 +237,7 @@
public void doTick() { public void doTick() {
super.doTick(); super.doTick();
if (this.getWorldData().isHardcore() && this.getDifficulty() != EnumDifficulty.HARD) { if (this.getWorldData().isHardcore() && this.getDifficulty() != EnumDifficulty.HARD) {
@@ -110,8 +280,11 @@ @@ -110,8 +283,11 @@
} }
this.methodProfiler.a("mobSpawner"); this.methodProfiler.a("mobSpawner");
@ -248,7 +251,7 @@
} }
this.methodProfiler.c("chunkSource"); this.methodProfiler.c("chunkSource");
@@ -140,6 +313,8 @@ @@ -140,6 +316,8 @@
this.portalTravelAgent.a(this.getTime()); this.portalTravelAgent.a(this.getTime());
this.methodProfiler.b(); this.methodProfiler.b();
this.aq(); this.aq();
@ -257,7 +260,7 @@
} }
@Nullable @Nullable
@@ -167,7 +342,7 @@ @@ -167,7 +345,7 @@
if (entityhuman.isSpectator()) { if (entityhuman.isSpectator()) {
++i; ++i;
@ -266,7 +269,7 @@
++j; ++j;
} }
} }
@@ -195,25 +370,46 @@ @@ -195,25 +373,46 @@
} }
private void c() { private void c() {
@ -317,7 +320,7 @@
return false; return false;
} else { } else {
@@ -283,7 +479,7 @@ @@ -283,7 +482,7 @@
entityhorseskeleton.p(true); entityhorseskeleton.p(true);
entityhorseskeleton.setAgeRaw(0); entityhorseskeleton.setAgeRaw(0);
entityhorseskeleton.setPosition((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ()); entityhorseskeleton.setPosition((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
@ -326,7 +329,7 @@
this.strikeLightning(new EntityLightning(this, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), true)); this.strikeLightning(new EntityLightning(this, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), true));
} else { } else {
this.strikeLightning(new EntityLightning(this, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), false)); this.strikeLightning(new EntityLightning(this, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), false));
@@ -299,11 +495,11 @@ @@ -299,11 +498,11 @@
BlockPosition blockposition1 = blockposition.down(); BlockPosition blockposition1 = blockposition.down();
if (this.v(blockposition1)) { if (this.v(blockposition1)) {
@ -340,7 +343,7 @@
} }
if (flag && this.getBiome(blockposition1).d()) { if (flag && this.getBiome(blockposition1).d()) {
@@ -378,7 +574,7 @@ @@ -378,7 +577,7 @@
public boolean b(BlockPosition blockposition, Block block) { public boolean b(BlockPosition blockposition, Block block) {
NextTickListEntry nextticklistentry = new NextTickListEntry(blockposition, block); NextTickListEntry nextticklistentry = new NextTickListEntry(blockposition, block);
@ -349,7 +352,7 @@
} }
public void a(BlockPosition blockposition, Block block, int i) { public void a(BlockPosition blockposition, Block block, int i) {
@@ -412,8 +608,8 @@ @@ -412,8 +611,8 @@
nextticklistentry.a(j); nextticklistentry.a(j);
} }
@ -360,7 +363,7 @@
this.nextTickList.add(nextticklistentry); this.nextTickList.add(nextticklistentry);
} }
} }
@@ -430,15 +626,15 @@ @@ -430,15 +629,15 @@
nextticklistentry.a((long) i + this.worldData.getTime()); nextticklistentry.a((long) i + this.worldData.getTime());
} }
@ -379,7 +382,7 @@
if (this.emptyTime++ >= 300) { if (this.emptyTime++ >= 300) {
return; return;
} }
@@ -508,11 +704,17 @@ @@ -508,11 +707,17 @@
} else { } else {
int i = this.nextTickList.size(); int i = this.nextTickList.size();
@ -399,7 +402,7 @@
} }
this.methodProfiler.a("cleaning"); this.methodProfiler.a("cleaning");
@@ -525,8 +727,9 @@ @@ -525,8 +730,9 @@
break; break;
} }
@ -410,7 +413,7 @@
this.W.add(nextticklistentry); this.W.add(nextticklistentry);
} }
@@ -596,7 +799,7 @@ @@ -596,7 +802,7 @@
if (blockposition.getX() >= structureboundingbox.a && blockposition.getX() < structureboundingbox.d && blockposition.getZ() >= structureboundingbox.c && blockposition.getZ() < structureboundingbox.f) { if (blockposition.getX() >= structureboundingbox.a && blockposition.getX() < structureboundingbox.d && blockposition.getZ() >= structureboundingbox.c && blockposition.getZ() < structureboundingbox.f) {
if (flag) { if (flag) {
if (i == 0) { if (i == 0) {
@ -419,7 +422,7 @@
} }
iterator.remove(); iterator.remove();
@@ -614,6 +817,7 @@ @@ -614,6 +820,7 @@
return arraylist; return arraylist;
} }
@ -427,7 +430,7 @@
public void entityJoinedWorld(Entity entity, boolean flag) { public void entityJoinedWorld(Entity entity, boolean flag) {
if (!this.getSpawnAnimals() && (entity instanceof EntityAnimal || entity instanceof EntityWaterAnimal)) { if (!this.getSpawnAnimals() && (entity instanceof EntityAnimal || entity instanceof EntityWaterAnimal)) {
entity.die(); entity.die();
@@ -625,6 +829,7 @@ @@ -625,6 +832,7 @@
super.entityJoinedWorld(entity, flag); super.entityJoinedWorld(entity, flag);
} }
@ -435,7 +438,7 @@
private boolean getSpawnNPCs() { private boolean getSpawnNPCs() {
return this.server.getSpawnNPCs(); return this.server.getSpawnNPCs();
@@ -637,7 +842,54 @@ @@ -637,7 +845,54 @@
protected IChunkProvider n() { protected IChunkProvider n() {
IChunkLoader ichunkloader = this.dataManager.createChunkLoader(this.worldProvider); IChunkLoader ichunkloader = this.dataManager.createChunkLoader(this.worldProvider);
@ -491,7 +494,7 @@
} }
public boolean a(EntityHuman entityhuman, BlockPosition blockposition) { public boolean a(EntityHuman entityhuman, BlockPosition blockposition) {
@@ -699,6 +951,23 @@ @@ -699,6 +954,23 @@
int j = this.worldProvider.getSeaLevel(); int j = this.worldProvider.getSeaLevel();
int k = 8; int k = 8;
@ -515,7 +518,7 @@
if (blockposition != null) { if (blockposition != null) {
i = blockposition.getX(); i = blockposition.getX();
k = blockposition.getZ(); k = blockposition.getZ();
@@ -708,7 +977,7 @@ @@ -708,7 +980,7 @@
int l = 0; int l = 0;
@ -524,7 +527,7 @@
i += random.nextInt(64) - random.nextInt(64); i += random.nextInt(64) - random.nextInt(64);
k += random.nextInt(64) - random.nextInt(64); k += random.nextInt(64) - random.nextInt(64);
++l; ++l;
@@ -750,6 +1019,7 @@ @@ -750,6 +1022,7 @@
ChunkProviderServer chunkproviderserver = this.getChunkProviderServer(); ChunkProviderServer chunkproviderserver = this.getChunkProviderServer();
if (chunkproviderserver.e()) { if (chunkproviderserver.e()) {
@ -532,7 +535,7 @@
if (iprogressupdate != null) { if (iprogressupdate != null) {
iprogressupdate.a("Saving level"); iprogressupdate.a("Saving level");
} }
@@ -760,7 +1030,8 @@ @@ -760,7 +1033,8 @@
} }
chunkproviderserver.a(flag); chunkproviderserver.a(flag);
@ -542,7 +545,7 @@
Iterator iterator = arraylist.iterator(); Iterator iterator = arraylist.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
@@ -795,6 +1066,12 @@ @@ -795,6 +1069,12 @@
} }
} }
@ -555,7 +558,7 @@
this.worldData.a(this.getWorldBorder().getSize()); this.worldData.a(this.getWorldBorder().getSize());
this.worldData.d(this.getWorldBorder().getCenterX()); this.worldData.d(this.getWorldBorder().getCenterX());
this.worldData.c(this.getWorldBorder().getCenterZ()); this.worldData.c(this.getWorldBorder().getCenterZ());
@@ -808,9 +1085,13 @@ @@ -808,9 +1088,13 @@
this.worldMaps.a(); this.worldMaps.a();
} }
@ -571,7 +574,7 @@
public void a(Collection<Entity> collection) { public void a(Collection<Entity> collection) {
ArrayList arraylist = Lists.newArrayList(collection); ArrayList arraylist = Lists.newArrayList(collection);
@@ -829,7 +1110,7 @@ @@ -829,7 +1113,7 @@
private boolean j(Entity entity) { private boolean j(Entity entity) {
if (entity.dead) { if (entity.dead) {
@ -580,7 +583,7 @@
return false; return false;
} else { } else {
UUID uuid = entity.getUniqueID(); UUID uuid = entity.getUniqueID();
@@ -841,7 +1122,7 @@ @@ -841,7 +1125,7 @@
this.f.remove(entity1); this.f.remove(entity1);
} else { } else {
if (!(entity instanceof EntityHuman)) { if (!(entity instanceof EntityHuman)) {
@ -589,7 +592,7 @@
return false; return false;
} }
@@ -894,8 +1175,16 @@ @@ -894,8 +1178,16 @@
} }
public boolean strikeLightning(Entity entity) { public boolean strikeLightning(Entity entity) {
@ -607,7 +610,7 @@
return true; return true;
} else { } else {
return false; return false;
@@ -911,10 +1200,20 @@ @@ -911,10 +1203,20 @@
} }
public Explosion createExplosion(@Nullable Entity entity, double d0, double d1, double d2, float f, boolean flag, boolean flag1) { public Explosion createExplosion(@Nullable Entity entity, double d0, double d1, double d2, float f, boolean flag, boolean flag1) {
@ -628,7 +631,7 @@
if (!flag1) { if (!flag1) {
explosion.clearBlocks(); explosion.clearBlocks();
} }
@@ -960,7 +1259,8 @@ @@ -960,7 +1262,8 @@
BlockActionData blockactiondata = (BlockActionData) iterator.next(); BlockActionData blockactiondata = (BlockActionData) iterator.next();
if (this.a(blockactiondata)) { if (this.a(blockactiondata)) {
@ -638,7 +641,7 @@
} }
} }
@@ -983,6 +1283,7 @@ @@ -983,6 +1286,7 @@
boolean flag = this.isRaining(); boolean flag = this.isRaining();
super.t(); super.t();
@ -646,7 +649,7 @@
if (this.n != this.o) { if (this.n != this.o) {
this.server.getPlayerList().a((Packet) (new PacketPlayOutGameStateChange(7, this.o)), this.worldProvider.getDimensionManager().getDimensionID()); this.server.getPlayerList().a((Packet) (new PacketPlayOutGameStateChange(7, this.o)), this.worldProvider.getDimensionManager().getDimensionID());
} }
@@ -1001,6 +1302,21 @@ @@ -1001,6 +1305,21 @@
this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(7, this.o)); this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(7, this.o));
this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(8, this.q)); this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(8, this.q));
} }
@ -668,7 +671,7 @@
} }
@@ -1030,10 +1346,20 @@ @@ -1030,10 +1349,20 @@
} }
public void a(EnumParticle enumparticle, boolean flag, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, int... aint) { public void a(EnumParticle enumparticle, boolean flag, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, int... aint) {