From 4509a144db68e6d0b7a6ead1f2095c32cba7f26d Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 15 Apr 2018 10:21:11 +1000 Subject: SPIGOT-3899: Only load advancements from primary world --- nms-patches/WorldServer.patch | 65 ++++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 31 deletions(-) (limited to 'nms-patches/WorldServer.patch') diff --git a/nms-patches/WorldServer.patch b/nms-patches/WorldServer.patch index b5178ece..682421ef 100644 --- a/nms-patches/WorldServer.patch +++ b/nms-patches/WorldServer.patch @@ -63,7 +63,7 @@ this.scoreboard = new ScoreboardServer(this.server); PersistentScoreboard persistentscoreboard = (PersistentScoreboard) this.worldMaps.get(PersistentScoreboard.class, "scoreboard"); -@@ -75,9 +96,21 @@ +@@ -75,9 +96,24 @@ persistentscoreboard.a(this.scoreboard); ((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.D = new CustomFunctionData(new File(new File(this.dataManager.getDirectory(), "data"), "functions"), this.server); + // CraftBukkit start ++ if (this.dimension != 0) { // SPIGOT-3899 multiple worlds of advancements not supported ++ this.C = this.server.getAdvancementData(); ++ } + if (this.C == null) { + 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().setDamageAmount(this.worldData.H()); this.getWorldBorder().setDamageBuffer(this.worldData.G()); -@@ -89,9 +122,146 @@ +@@ -89,9 +125,146 @@ this.getWorldBorder().setSize(this.worldData.D()); } @@ -234,7 +237,7 @@ public void doTick() { super.doTick(); if (this.getWorldData().isHardcore() && this.getDifficulty() != EnumDifficulty.HARD) { -@@ -110,8 +280,11 @@ +@@ -110,8 +283,11 @@ } this.methodProfiler.a("mobSpawner"); @@ -248,7 +251,7 @@ } this.methodProfiler.c("chunkSource"); -@@ -140,6 +313,8 @@ +@@ -140,6 +316,8 @@ this.portalTravelAgent.a(this.getTime()); this.methodProfiler.b(); this.aq(); @@ -257,7 +260,7 @@ } @Nullable -@@ -167,7 +342,7 @@ +@@ -167,7 +345,7 @@ if (entityhuman.isSpectator()) { ++i; @@ -266,7 +269,7 @@ ++j; } } -@@ -195,25 +370,46 @@ +@@ -195,25 +373,46 @@ } private void c() { @@ -317,7 +320,7 @@ return false; } else { -@@ -283,7 +479,7 @@ +@@ -283,7 +482,7 @@ entityhorseskeleton.p(true); entityhorseskeleton.setAgeRaw(0); 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)); } else { 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(); if (this.v(blockposition1)) { @@ -340,7 +343,7 @@ } if (flag && this.getBiome(blockposition1).d()) { -@@ -378,7 +574,7 @@ +@@ -378,7 +577,7 @@ public boolean b(BlockPosition blockposition, Block block) { NextTickListEntry nextticklistentry = new NextTickListEntry(blockposition, block); @@ -349,7 +352,7 @@ } public void a(BlockPosition blockposition, Block block, int i) { -@@ -412,8 +608,8 @@ +@@ -412,8 +611,8 @@ nextticklistentry.a(j); } @@ -360,7 +363,7 @@ this.nextTickList.add(nextticklistentry); } } -@@ -430,15 +626,15 @@ +@@ -430,15 +629,15 @@ nextticklistentry.a((long) i + this.worldData.getTime()); } @@ -379,7 +382,7 @@ if (this.emptyTime++ >= 300) { return; } -@@ -508,11 +704,17 @@ +@@ -508,11 +707,17 @@ } else { int i = this.nextTickList.size(); @@ -399,7 +402,7 @@ } this.methodProfiler.a("cleaning"); -@@ -525,8 +727,9 @@ +@@ -525,8 +730,9 @@ break; } @@ -410,7 +413,7 @@ 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 (flag) { if (i == 0) { @@ -419,7 +422,7 @@ } iterator.remove(); -@@ -614,6 +817,7 @@ +@@ -614,6 +820,7 @@ return arraylist; } @@ -427,7 +430,7 @@ public void entityJoinedWorld(Entity entity, boolean flag) { if (!this.getSpawnAnimals() && (entity instanceof EntityAnimal || entity instanceof EntityWaterAnimal)) { entity.die(); -@@ -625,6 +829,7 @@ +@@ -625,6 +832,7 @@ super.entityJoinedWorld(entity, flag); } @@ -435,7 +438,7 @@ private boolean getSpawnNPCs() { return this.server.getSpawnNPCs(); -@@ -637,7 +842,54 @@ +@@ -637,7 +845,54 @@ protected IChunkProvider n() { IChunkLoader ichunkloader = this.dataManager.createChunkLoader(this.worldProvider); @@ -491,7 +494,7 @@ } public boolean a(EntityHuman entityhuman, BlockPosition blockposition) { -@@ -699,6 +951,23 @@ +@@ -699,6 +954,23 @@ int j = this.worldProvider.getSeaLevel(); int k = 8; @@ -515,7 +518,7 @@ if (blockposition != null) { i = blockposition.getX(); k = blockposition.getZ(); -@@ -708,7 +977,7 @@ +@@ -708,7 +980,7 @@ int l = 0; @@ -524,7 +527,7 @@ i += random.nextInt(64) - random.nextInt(64); k += random.nextInt(64) - random.nextInt(64); ++l; -@@ -750,6 +1019,7 @@ +@@ -750,6 +1022,7 @@ ChunkProviderServer chunkproviderserver = this.getChunkProviderServer(); if (chunkproviderserver.e()) { @@ -532,7 +535,7 @@ if (iprogressupdate != null) { iprogressupdate.a("Saving level"); } -@@ -760,7 +1030,8 @@ +@@ -760,7 +1033,8 @@ } chunkproviderserver.a(flag); @@ -542,7 +545,7 @@ Iterator iterator = arraylist.iterator(); while (iterator.hasNext()) { -@@ -795,6 +1066,12 @@ +@@ -795,6 +1069,12 @@ } } @@ -555,7 +558,7 @@ this.worldData.a(this.getWorldBorder().getSize()); this.worldData.d(this.getWorldBorder().getCenterX()); this.worldData.c(this.getWorldBorder().getCenterZ()); -@@ -808,9 +1085,13 @@ +@@ -808,9 +1088,13 @@ this.worldMaps.a(); } @@ -571,7 +574,7 @@ public void a(Collection collection) { ArrayList arraylist = Lists.newArrayList(collection); -@@ -829,7 +1110,7 @@ +@@ -829,7 +1113,7 @@ private boolean j(Entity entity) { if (entity.dead) { @@ -580,7 +583,7 @@ return false; } else { UUID uuid = entity.getUniqueID(); -@@ -841,7 +1122,7 @@ +@@ -841,7 +1125,7 @@ this.f.remove(entity1); } else { if (!(entity instanceof EntityHuman)) { @@ -589,7 +592,7 @@ return false; } -@@ -894,8 +1175,16 @@ +@@ -894,8 +1178,16 @@ } public boolean strikeLightning(Entity entity) { @@ -607,7 +610,7 @@ return true; } else { 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) { @@ -628,7 +631,7 @@ if (!flag1) { explosion.clearBlocks(); } -@@ -960,7 +1259,8 @@ +@@ -960,7 +1262,8 @@ BlockActionData blockactiondata = (BlockActionData) iterator.next(); if (this.a(blockactiondata)) { @@ -638,7 +641,7 @@ } } -@@ -983,6 +1283,7 @@ +@@ -983,6 +1286,7 @@ boolean flag = this.isRaining(); super.t(); @@ -646,7 +649,7 @@ if (this.n != this.o) { 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(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) { -- cgit v1.2.3