diff options
Diffstat (limited to 'nms-patches/WorldServer.patch')
-rw-r--r-- | nms-patches/WorldServer.patch | 92 |
1 files changed, 39 insertions, 53 deletions
diff --git a/nms-patches/WorldServer.patch b/nms-patches/WorldServer.patch index c16bedce..f9dc2e92 100644 --- a/nms-patches/WorldServer.patch +++ b/nms-patches/WorldServer.patch @@ -1,20 +1,6 @@ --- a/net/minecraft/server/WorldServer.java +++ b/net/minecraft/server/WorldServer.java -@@ -3,7 +3,6 @@ - import com.google.common.base.Predicate; - import com.google.common.collect.Lists; - import com.google.common.collect.Maps; --import com.google.common.collect.Sets; - import com.google.common.util.concurrent.ListenableFuture; - import java.io.File; - import java.util.ArrayList; -@@ -12,20 +11,29 @@ - import java.util.List; - import java.util.Map; - import java.util.Random; --import java.util.Set; --import java.util.TreeSet; - import java.util.UUID; +@@ -18,14 +18,25 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -42,7 +28,7 @@ private final Map<UUID, Entity> entitiesByUUID = Maps.newHashMap(); public boolean savingDisabled; private boolean O; -@@ -37,14 +45,22 @@ +@@ -37,14 +48,22 @@ private int T; private List<NextTickListEntry> U = Lists.newArrayList(); @@ -68,7 +54,7 @@ this.H(); this.I(); this.getWorldBorder().a(minecraftserver.aD()); -@@ -63,6 +79,7 @@ +@@ -63,6 +82,7 @@ this.villages.a((World) this); } @@ -76,7 +62,7 @@ this.scoreboard = new ScoreboardServer(this.server); PersistentScoreboard persistentscoreboard = (PersistentScoreboard) this.worldMaps.get(PersistentScoreboard.class, "scoreboard"); -@@ -73,6 +90,11 @@ +@@ -73,6 +93,11 @@ persistentscoreboard.a(this.scoreboard); ((ScoreboardServer) this.scoreboard).a((Runnable) (new RunnableSaveScoreboard(persistentscoreboard))); @@ -88,7 +74,7 @@ this.B = new LootTableRegistry(new File(new File(this.dataManager.getDirectory(), "data"), "loot_tables")); this.getWorldBorder().setCenter(this.worldData.B(), this.worldData.C()); this.getWorldBorder().setDamageAmount(this.worldData.H()); -@@ -85,9 +107,98 @@ +@@ -85,9 +110,98 @@ this.getWorldBorder().setSize(this.worldData.D()); } @@ -187,7 +173,7 @@ public void doTick() { super.doTick(); if (this.getWorldData().isHardcore() && this.getDifficulty() != EnumDifficulty.HARD) { -@@ -105,9 +216,11 @@ +@@ -105,9 +219,11 @@ this.f(); } @@ -202,7 +188,7 @@ } this.methodProfiler.c("chunkSource"); -@@ -136,6 +249,8 @@ +@@ -136,6 +252,8 @@ this.portalTravelAgent.a(this.getTime()); this.methodProfiler.b(); this.ao(); @@ -211,7 +197,7 @@ } public BiomeBase.BiomeMeta a(EnumCreatureType enumcreaturetype, BlockPosition blockposition) { -@@ -162,7 +277,7 @@ +@@ -162,7 +280,7 @@ if (entityhuman.isSpectator()) { ++i; @@ -220,7 +206,7 @@ ++j; } } -@@ -188,25 +303,46 @@ +@@ -188,25 +306,46 @@ } private void c() { @@ -271,7 +257,7 @@ return false; } else { -@@ -277,7 +413,7 @@ +@@ -277,7 +416,7 @@ entityhorse.x(true); entityhorse.setAgeRaw(0); entityhorse.setPosition((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ()); @@ -280,7 +266,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)); -@@ -293,11 +429,29 @@ +@@ -293,11 +432,29 @@ BlockPosition blockposition1 = blockposition.down(); if (this.v(blockposition1)) { @@ -312,7 +298,7 @@ } if (flag && this.getBiome(blockposition1).d()) { -@@ -372,7 +526,7 @@ +@@ -372,7 +529,7 @@ public boolean b(BlockPosition blockposition, Block block) { NextTickListEntry nextticklistentry = new NextTickListEntry(blockposition, block); @@ -321,7 +307,7 @@ } public void a(BlockPosition blockposition, Block block, int i) { -@@ -413,8 +567,8 @@ +@@ -411,8 +568,8 @@ nextticklistentry.a(j); } @@ -332,7 +318,7 @@ this.nextTickList.add(nextticklistentry); } } -@@ -436,15 +590,15 @@ +@@ -434,15 +591,15 @@ nextticklistentry.a((long) i + this.worldData.getTime()); } @@ -351,7 +337,7 @@ if (this.emptyTime++ >= 300) { return; } -@@ -514,11 +668,17 @@ +@@ -512,11 +669,17 @@ } else { int i = this.nextTickList.size(); @@ -359,19 +345,19 @@ + if (false) { // CraftBukkit throw new IllegalStateException("TickNextTick list out of synch"); } else { - if (i > 1000) { -- i = 1000; + if (i > 65536) { +- i = 65536; + // CraftBukkit start - If the server has too much to process over time, try to alleviate that -+ if (i > 20 * 1000) { ++ if (i > 20 * 65536) { + i = i / 20; + } else { -+ i = 1000; ++ i = 65536; + } + // CraftBukkit end } this.methodProfiler.a("cleaning"); -@@ -531,8 +691,9 @@ +@@ -529,8 +692,9 @@ break; } @@ -382,7 +368,7 @@ this.U.add(nextticklistentry); } -@@ -600,7 +761,7 @@ +@@ -598,7 +762,7 @@ if (blockposition.getX() >= structureboundingbox.a && blockposition.getX() < structureboundingbox.d && blockposition.getZ() >= structureboundingbox.c && blockposition.getZ() < structureboundingbox.f) { if (flag) { if (i == 0) { @@ -391,7 +377,7 @@ } iterator.remove(); -@@ -618,6 +779,7 @@ +@@ -616,6 +780,7 @@ return arraylist; } @@ -399,7 +385,7 @@ public void entityJoinedWorld(Entity entity, boolean flag) { if (!this.getSpawnAnimals() && (entity instanceof EntityAnimal || entity instanceof EntityWaterAnimal)) { entity.die(); -@@ -629,6 +791,7 @@ +@@ -627,6 +792,7 @@ super.entityJoinedWorld(entity, flag); } @@ -407,7 +393,7 @@ private boolean getSpawnNPCs() { return this.server.getSpawnNPCs(); -@@ -641,12 +804,42 @@ +@@ -639,12 +805,42 @@ protected IChunkProvider n() { IChunkLoader ichunkloader = this.dataManager.createChunkLoader(this.worldProvider); @@ -451,7 +437,7 @@ for (int k1 = 0; k1 < this.tileEntityList.size(); ++k1) { TileEntity tileentity = (TileEntity) this.tileEntityList.get(k1); BlockPosition blockposition = tileentity.getPosition(); -@@ -655,6 +848,8 @@ +@@ -653,6 +849,8 @@ arraylist.add(tileentity); } } @@ -460,7 +446,7 @@ return arraylist; } -@@ -718,6 +913,23 @@ +@@ -716,6 +914,23 @@ int j = this.worldProvider.getSeaLevel(); int k = 8; @@ -484,7 +470,7 @@ if (blockposition != null) { i = blockposition.getX(); k = blockposition.getZ(); -@@ -727,7 +939,7 @@ +@@ -725,7 +940,7 @@ int l = 0; @@ -493,7 +479,7 @@ i += random.nextInt(64) - random.nextInt(64); k += random.nextInt(64) - random.nextInt(64); ++l; -@@ -768,6 +980,7 @@ +@@ -766,6 +981,7 @@ ChunkProviderServer chunkproviderserver = this.getChunkProviderServer(); if (chunkproviderserver.e()) { @@ -501,7 +487,7 @@ if (iprogressupdate != null) { iprogressupdate.a("Saving level"); } -@@ -778,7 +991,8 @@ +@@ -776,7 +992,8 @@ } chunkproviderserver.a(flag); @@ -511,7 +497,7 @@ Iterator iterator = arraylist.iterator(); while (iterator.hasNext()) { -@@ -813,6 +1027,12 @@ +@@ -811,6 +1028,12 @@ } } @@ -524,7 +510,7 @@ this.worldData.a(this.getWorldBorder().getSize()); this.worldData.d(this.getWorldBorder().getCenterX()); this.worldData.c(this.getWorldBorder().getCenterZ()); -@@ -822,8 +1042,12 @@ +@@ -820,8 +1043,12 @@ this.worldData.k(this.getWorldBorder().getWarningTime()); this.worldData.b(this.getWorldBorder().j()); this.worldData.e(this.getWorldBorder().i()); @@ -538,7 +524,7 @@ } public boolean addEntity(Entity entity) { -@@ -847,7 +1071,7 @@ +@@ -845,7 +1072,7 @@ private boolean i(Entity entity) { if (entity.dead) { @@ -547,7 +533,7 @@ return false; } else { UUID uuid = entity.getUniqueID(); -@@ -859,7 +1083,7 @@ +@@ -857,7 +1084,7 @@ this.f.remove(entity1); } else { if (!(entity instanceof EntityHuman)) { @@ -556,7 +542,7 @@ return false; } -@@ -902,6 +1126,14 @@ +@@ -900,6 +1127,14 @@ } public boolean strikeLightning(Entity entity) { @@ -571,7 +557,7 @@ if (super.strikeLightning(entity)) { this.server.getPlayerList().sendPacketNearby((EntityHuman) null, entity.locX, entity.locY, entity.locZ, 512.0D, this.worldProvider.getDimensionManager().getDimensionID(), new PacketPlayOutSpawnEntityWeather(entity)); return true; -@@ -919,10 +1151,20 @@ +@@ -917,10 +1152,20 @@ } public Explosion createExplosion(Entity entity, double d0, double d1, double d2, float f, boolean flag, boolean flag1) { @@ -592,7 +578,7 @@ if (!flag1) { explosion.clearBlocks(); } -@@ -968,7 +1210,8 @@ +@@ -966,7 +1211,8 @@ BlockActionData blockactiondata = (BlockActionData) iterator.next(); if (this.a(blockactiondata)) { @@ -602,7 +588,7 @@ } } -@@ -991,6 +1234,7 @@ +@@ -989,6 +1235,7 @@ boolean flag = this.W(); super.t(); @@ -610,7 +596,7 @@ if (this.n != this.o) { this.server.getPlayerList().a((Packet) (new PacketPlayOutGameStateChange(7, this.o)), this.worldProvider.getDimensionManager().getDimensionID()); } -@@ -1009,6 +1253,21 @@ +@@ -1007,6 +1254,21 @@ this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(7, this.o)); this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(8, this.q)); } @@ -632,7 +618,7 @@ } -@@ -1037,10 +1296,20 @@ +@@ -1035,10 +1297,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) { |