Files
Purpur/patches/server/0135-Origami-Fix-ProtocolLib-issues-on-Java-15.patch
BillyGalbreath e53522571d Updated Upstream (Paper & Tuinity)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
808bd9198 Add fast alternative constructor for Vector3f (#5339)
e849c51da fix #5336
0b25bacfc fix patch 'Remove streams from SensorNearest' (fixes #5330)
4d287e31c Use Adventure for `/version` command feedback, add copy to clipboard click event (#5333)

Tuinity Changes:
5b6d8beec: Update Upstream (Paper)
81d5fc1dd: Fix NPE in pickup logic for arrow
19ac6608f: Move region chunk unload & poi unload hook up
38ad5a1bd: Do not run close logic for inventories on chunk load
fb75a6f83: Do not allow the server to unload chunks at request of plugins
f87cb795f: Make entity tracker use highest range of passengers
71b089f18: Do not run raytrace logic for AIR
09e1a1036: Fix NPE in light exception handler
0ae7c2c23: Dump even more info for ticking entities
2e4a930c4: Store changed positions inside field on light engine
7734ef0a9: Detail player ticking in watchdog dumps
2021-03-11 15:01:23 -06:00

66 lines
3.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Phoenix616 <max@themoep.de>
Date: Mon, 19 Oct 2020 17:20:53 +0100
Subject: [PATCH] Origami - Fix ProtocolLib issues on Java 15
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
index 65de374d485f31f8cd6f4e03941173565074ea0e..ea86843fa0313da15b905cbd712c15e7b217daa4 100644
--- a/src/main/java/net/minecraft/server/NetworkManager.java
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
@@ -394,9 +394,9 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
// note: since the type is not dynamic here, we need to actually copy the old executor code
// into two branches. On conflict, just re-copy - no changes were made inside the executor code.
if (flush) {
- choice1 = () -> {
+ choice1 = new Runnable() { public void run() { // Origami - flatten lambda
if (enumprotocol != enumprotocol1) {
- this.setProtocol(enumprotocol);
+ NetworkManager.this.setProtocol(enumprotocol); // Origami - flatten lambda
}
// Paper start
@@ -406,7 +406,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
}
try {
// Paper end
- ChannelFuture channelfuture1 = (flush) ? this.channel.writeAndFlush(packet) : this.channel.write(packet); // Tuinity - add flush parameter
+ ChannelFuture channelfuture1 = (flush) ? NetworkManager.this.channel.writeAndFlush(packet) : NetworkManager.this.channel.write(packet); // Tuinity - add flush parameter // Origami - flatten lambda
if (genericfuturelistener != null) {
@@ -426,12 +426,12 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
packet.onPacketDispatchFinish(player, null);
}
// Paper end
- };
+ }}; // Origami - flatten lambda
} else {
// explicitly declare a variable to make the lambda use the type
- choice2 = () -> {
+ choice2 = new AbstractEventExecutor.LazyRunnable() { public void run() { // Origami - flatten lambda
if (enumprotocol != enumprotocol1) {
- this.setProtocol(enumprotocol);
+ NetworkManager.this.setProtocol(enumprotocol); // Origami - flatten lambda
}
// Paper start
@@ -441,7 +441,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
}
try {
// Paper end
- ChannelFuture channelfuture1 = (flush) ? this.channel.writeAndFlush(packet) : this.channel.write(packet); // Tuinity - add flush parameter
+ ChannelFuture channelfuture1 = (flush) ? NetworkManager.this.channel.writeAndFlush(packet) : NetworkManager.this.channel.write(packet); // Tuinity - add flush parameter // Origami - flatten lambda
if (genericfuturelistener != null) {
@@ -461,7 +461,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
packet.onPacketDispatchFinish(player, null);
}
// Paper end
- };
+ }}; // Origami - flatten lambda
}
this.channel.eventLoop().execute(choice1 != null ? choice1 : choice2);
// Tuinity end - optimise packets that are not flushed