diff --git a/patches/server/0013-Optimizations-for-network.patch b/patches/server/0013-Optimizations-for-network.patch index e3139da0b..de8b24175 100644 --- a/patches/server/0013-Optimizations-for-network.patch +++ b/patches/server/0013-Optimizations-for-network.patch @@ -1,4 +1,4 @@ -From 2586ac1cc5a0b940aa0b46721383c28e615e0dab Mon Sep 17 00:00:00 2001 +From c3da24e911229cfcf8530507d75c719ce463b3eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=84=97=E3=84=A0=CB=8B=20=E3=84=91=E3=84=A7=CB=8A?= Date: Sun, 5 Apr 2020 14:59:10 +0800 @@ -106,7 +106,7 @@ index f1222fcb2b..522cfed4cb 100644 protected GameProfile a(GameProfile gameprofile) { diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 96a785af27..f2a31f5923 100644 +index 96a785af27..fd1d5fe3bf 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -43,6 +43,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { @@ -145,7 +145,7 @@ index 96a785af27..f2a31f5923 100644 if (enumprotocol != enumprotocol1) { this.setProtocol(enumprotocol); } -@@ -223,30 +225,71 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -223,30 +225,92 @@ public class NetworkManager extends SimpleChannelInboundHandler> { } @@ -179,13 +179,34 @@ index 96a785af27..f2a31f5923 100644 + NetworkManager.LOGGER.debug("Disabled auto read"); + this.channel.config().setAutoRead(false); + this.setProtocol(enumprotocol); -+ } -+ + } + +- return true; // Return true if all packets were dispatched + ChannelFuture channelfuture = this.channel.writeAndFlush(packet); + + channelfuture.addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + + } ++ ++ public void sendPackets(Packet packet, Packet other) { ++ EnumProtocol enumprotocol = packet.protocol(); ++ ++ ++this.q; ++ if (protocol != enumprotocol) { ++ NetworkManager.LOGGER.debug("Disabled auto read"); ++ this.channel.config().setAutoRead(false); ++ } ++ ++ this.channel.eventLoop().execute(() -> { ++ if (enumprotocol != protocol) { ++ this.setProtocol(enumprotocol); ++ } ++ ++ this.channel.write(packet).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); ++ this.channel.write(other).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); ++ this.channel.flush(); ++ }); ++ } + + public void sendPackets(Packet packet, Packet ...packets) { + EnumProtocol enumprotocol = packet.protocol(); @@ -194,9 +215,8 @@ index 96a785af27..f2a31f5923 100644 + if (protocol != enumprotocol) { + NetworkManager.LOGGER.debug("Disabled auto read"); + this.channel.config().setAutoRead(false); - } - -- return true; // Return true if all packets were dispatched ++ } ++ + this.channel.eventLoop().execute(() -> { + if (enumprotocol != protocol) { + this.setProtocol(enumprotocol); @@ -206,6 +226,7 @@ index 96a785af27..f2a31f5923 100644 + for (Packet pkt : packets) { + this.channel.write(pkt).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + } ++ + this.channel.flush(); + }); + } @@ -238,7 +259,7 @@ index 96a785af27..f2a31f5923 100644 } // Paper end -@@ -260,9 +303,9 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -260,9 +324,9 @@ public class NetworkManager extends SimpleChannelInboundHandler> { ((PlayerConnection) this.packetListener).tick(); } @@ -408,29 +429,33 @@ index 6dfbbc67dd..b23612817b 100644 @Override diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 6d6fbf2f50..4b549ccc41 100644 +index 6d6fbf2f50..fa23e838ee 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -159,13 +159,15 @@ public abstract class PlayerList { +@@ -159,6 +159,8 @@ public abstract class PlayerList { // Spigot - view distance playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), WorldData.c(worlddata.getSeed()), worlddata.isHardcore(), worldserver.worldProvider.getDimensionManager().getType(), this.getMaxPlayers(), worlddata.getType(), worldserver.spigotConfig.viewDistance, flag1, !flag)); entityplayer.getBukkitEntity().sendSupportedChannels(); // CraftBukkit -- playerconnection.sendPacket(new PacketPlayOutCustomPayload(PacketPlayOutCustomPayload.a, (new PacketDataSerializer(Unpooled.buffer())).a(this.getServer().getServerModName()))); -- playerconnection.sendPacket(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked())); -- playerconnection.sendPacket(new PacketPlayOutAbilities(entityplayer.abilities)); -- playerconnection.sendPacket(new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex)); -- playerconnection.sendPacket(new PacketPlayOutRecipeUpdate(this.server.getCraftingManager().b())); -- playerconnection.sendPacket(new PacketPlayOutTags(this.server.getTagRegistry())); -- playerconnection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, (byte) (worldserver.getGameRules().getBoolean(GameRules.REDUCED_DEBUG_INFO) ? 22 : 23))); // Paper - fix this rule not being initialized on the client -+ // Akarin Start -+ playerconnection.networkManager.sendPackets(new PacketPlayOutCustomPayload(PacketPlayOutCustomPayload.a, (new PacketDataSerializer(Unpooled.buffer())).a(this.getServer().getServerModName())), -+ new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked()), -+ new PacketPlayOutAbilities(entityplayer.abilities), -+ new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex), -+ new PacketPlayOutRecipeUpdate(this.server.getCraftingManager().b()), -+ new PacketPlayOutTags(this.server.getTagRegistry()), -+ new PacketPlayOutEntityStatus(entityplayer, (byte) (worldserver.getGameRules().getBoolean(GameRules.REDUCED_DEBUG_INFO) ? 22 : 23))); // Paper - fix this rule not being initialized on the client -+ // Akarin End ++ // Akarin start - send multiple packets at once ++ /* + playerconnection.sendPacket(new PacketPlayOutCustomPayload(PacketPlayOutCustomPayload.a, (new PacketDataSerializer(Unpooled.buffer())).a(this.getServer().getServerModName()))); + playerconnection.sendPacket(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked())); + playerconnection.sendPacket(new PacketPlayOutAbilities(entityplayer.abilities)); +@@ -166,6 +168,17 @@ public abstract class PlayerList { + playerconnection.sendPacket(new PacketPlayOutRecipeUpdate(this.server.getCraftingManager().b())); + playerconnection.sendPacket(new PacketPlayOutTags(this.server.getTagRegistry())); + playerconnection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, (byte) (worldserver.getGameRules().getBoolean(GameRules.REDUCED_DEBUG_INFO) ? 22 : 23))); // Paper - fix this rule not being initialized on the client ++ */ ++ playerconnection.networkManager.sendPackets( ++ new PacketPlayOutCustomPayload(PacketPlayOutCustomPayload.a, (new PacketDataSerializer(Unpooled.buffer())).a(this.getServer().getServerModName())), ++ new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked()), ++ new PacketPlayOutAbilities(entityplayer.abilities), ++ new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex), ++ new PacketPlayOutRecipeUpdate(this.server.getCraftingManager().b()), ++ new PacketPlayOutTags(this.server.getTagRegistry()), ++ new PacketPlayOutEntityStatus(entityplayer, (byte) (worldserver.getGameRules().getBoolean(GameRules.REDUCED_DEBUG_INFO) ? 22 : 23)) ++ ); ++ // Akarin end this.d(entityplayer); entityplayer.getStatisticManager().c(); entityplayer.B().a(entityplayer); diff --git a/patches/server/0014-Swaps-the-predicate-order-of-collision.patch b/patches/server/0014-Swaps-the-predicate-order-of-collision.patch index 939b47d09..7c65063fb 100644 --- a/patches/server/0014-Swaps-the-predicate-order-of-collision.patch +++ b/patches/server/0014-Swaps-the-predicate-order-of-collision.patch @@ -1,4 +1,4 @@ -From 68179ee6442dc582e64a3501badb23979d2a04b4 Mon Sep 17 00:00:00 2001 +From e56c754100a66019abddd4b67521788e934ba89e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=84=97=E3=84=A0=CB=8B=20=E3=84=91=E3=84=A7=CB=8A?= Date: Fri, 10 Apr 2020 15:47:15 +0800 diff --git a/patches/server/0015-Tuinity-Use-ArrayDeque-for-pendingChunkUpdates-in-Ch.patch b/patches/server/0015-Tuinity-Use-ArrayDeque-for-pendingChunkUpdates-in-Ch.patch index e2173b4fc..6d9fdd1e4 100644 --- a/patches/server/0015-Tuinity-Use-ArrayDeque-for-pendingChunkUpdates-in-Ch.patch +++ b/patches/server/0015-Tuinity-Use-ArrayDeque-for-pendingChunkUpdates-in-Ch.patch @@ -1,4 +1,4 @@ -From e938a20dc137376d5f46fa6f1d70e556f1564cf8 Mon Sep 17 00:00:00 2001 +From 310f33996722b048faa9bf70c4beaca783de989b Mon Sep 17 00:00:00 2001 From: Sotr Date: Wed, 15 Apr 2020 02:39:12 +0700 Subject: [PATCH] Tuinity Use ArrayDeque for pendingChunkUpdates in diff --git a/patches/server/0016-Tuinity-Optimise-ArraySetSorted-removeIf.patch b/patches/server/0016-Tuinity-Optimise-ArraySetSorted-removeIf.patch index 4b46b0b1b..a694a5955 100644 --- a/patches/server/0016-Tuinity-Optimise-ArraySetSorted-removeIf.patch +++ b/patches/server/0016-Tuinity-Optimise-ArraySetSorted-removeIf.patch @@ -1,4 +1,4 @@ -From 66108ad190cd38d84f63acf6a0fcf9274328cea8 Mon Sep 17 00:00:00 2001 +From 448d83678ae21c978b2d7cd0294e8f412c317170 Mon Sep 17 00:00:00 2001 From: Sotr Date: Wed, 15 Apr 2020 02:44:07 +0700 Subject: [PATCH] Tuinity Optimise ArraySetSorted#removeIf diff --git a/patches/server/0017-Don-t-run-entity-collision-code-if-not-needed.patch b/patches/server/0017-Don-t-run-entity-collision-code-if-not-needed.patch index 2ca2d9565..24fd1549a 100644 --- a/patches/server/0017-Don-t-run-entity-collision-code-if-not-needed.patch +++ b/patches/server/0017-Don-t-run-entity-collision-code-if-not-needed.patch @@ -1,4 +1,4 @@ -From 15199cd32e2b5652cb7327a0023ffeedd691bcf4 Mon Sep 17 00:00:00 2001 +From 58097b8b6c20d860e27b7a159fceb52de55462aa Mon Sep 17 00:00:00 2001 From: Sotr Date: Wed, 15 Apr 2020 02:49:56 +0700 Subject: [PATCH] Don't run entity collision code if not needed diff --git a/patches/server/0018-Optimize-door-interact-with-pathfinding.patch b/patches/server/0018-Optimize-door-interact-with-pathfinding.patch index 0ce705c96..439fef6e9 100644 --- a/patches/server/0018-Optimize-door-interact-with-pathfinding.patch +++ b/patches/server/0018-Optimize-door-interact-with-pathfinding.patch @@ -1,4 +1,4 @@ -From b18cd3ce6068d169e62857776818a959edba0b7b Mon Sep 17 00:00:00 2001 +From ae21af5043b9d3664b1ad091d40268c007a963da Mon Sep 17 00:00:00 2001 From: Sotr Date: Wed, 15 Apr 2020 03:51:50 +0700 Subject: [PATCH] Optimize door interact with pathfinding diff --git a/patches/server/0019-Remove-stream-for-ender-teleport.patch b/patches/server/0019-Remove-stream-for-ender-teleport.patch index 86ca26c61..2d1ee9f27 100644 --- a/patches/server/0019-Remove-stream-for-ender-teleport.patch +++ b/patches/server/0019-Remove-stream-for-ender-teleport.patch @@ -1,4 +1,4 @@ -From 6476031ecb6212b4642a7676bb229a1c8f0bbc89 Mon Sep 17 00:00:00 2001 +From 7e98197e956e3201e2505815a653cbd77fa844b8 Mon Sep 17 00:00:00 2001 From: Sotr Date: Wed, 15 Apr 2020 04:16:44 +0700 Subject: [PATCH] Remove stream for ender teleport diff --git a/patches/server/0020-Cache-Hashcode-for-BlockPosition.patch b/patches/server/0020-Cache-Hashcode-for-BlockPosition.patch index 22a9edb37..77f568cc5 100644 --- a/patches/server/0020-Cache-Hashcode-for-BlockPosition.patch +++ b/patches/server/0020-Cache-Hashcode-for-BlockPosition.patch @@ -1,4 +1,4 @@ -From 6a4f18dea28f631dfacb16e988d6ada5ba270ad1 Mon Sep 17 00:00:00 2001 +From 086e6eb2ed02d55f55aa49404fe1b58ef92ec0d7 Mon Sep 17 00:00:00 2001 From: Sotr Date: Wed, 15 Apr 2020 04:28:25 +0700 Subject: [PATCH] Cache hashcode for BlockPosition diff --git a/patches/server/0021-Remove-stream-and-simplify-operation-in-pathfinder.patch b/patches/server/0021-Remove-stream-and-simplify-operation-in-pathfinder.patch index 8fa2ca026..9cbfb51bf 100644 --- a/patches/server/0021-Remove-stream-and-simplify-operation-in-pathfinder.patch +++ b/patches/server/0021-Remove-stream-and-simplify-operation-in-pathfinder.patch @@ -1,4 +1,4 @@ -From 92c476dd12cb5965f1c793f37b1181460ac3dfcd Mon Sep 17 00:00:00 2001 +From 973aed2e4aaa03aa708a697a9d0339f01f5f0e98 Mon Sep 17 00:00:00 2001 From: Sotr Date: Wed, 15 Apr 2020 17:49:07 +0700 Subject: [PATCH] Remove stream and simplify operation in pathfinder diff --git a/patches/server/0022-Remove-a-few-more-streams.patch b/patches/server/0022-Remove-a-few-more-streams.patch index 3eeacf18b..ef006e723 100644 --- a/patches/server/0022-Remove-a-few-more-streams.patch +++ b/patches/server/0022-Remove-a-few-more-streams.patch @@ -1,4 +1,4 @@ -From 8f14fe9582edf5a744a0b52089800dc4f645b275 Mon Sep 17 00:00:00 2001 +From 0793ce59f94297b12c49511ebe65c6f7914ea681 Mon Sep 17 00:00:00 2001 From: Sotr Date: Wed, 15 Apr 2020 22:45:48 +0700 Subject: [PATCH] Remove a few more streams