mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 47d48790d Change return type of ItemStack#editMeta to allow checking for successful vs non-successful edits 7aabe7d56 [CI-SKIP] fix minecart vs minecraft typos (#5713) f775e87b4 [CI-SKIP] ci: update setup-java action (#5710) c58b3b277 ci: replace Java 11 with Java 16 in GH Actions build flow (#5709) 4b72327a6 ItemStack#editMeta 68984b664 Add Unix domain socket support (#5611) 68c67e680 Add Mob#lookAt API (#5633) 4bacecd16 [Auto] Updated Upstream (Bukkit/CraftBukkit) 1f28e6eeb Fix default ChatRenderer when no plugins are installed (#5702) ecb0d32ca Enhance (Async)ChatEvent with per-viewer rendering API (#5684) Airplane Changes: 636dbff0f [ci skip] Cleanup mcdev import files c57932048 [ci skip] Remove icons 7ada9a476 [skip ci] Need to specify 1.16.5 in the README of course 813df1a44 Update README daf3f0b29 Optimize air case for raytracing
66 lines
3.8 KiB
Diff
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/network/NetworkManager.java b/src/main/java/net/minecraft/network/NetworkManager.java
|
|
index b6c0ef0df93f0350fa70e857e06d79ae34d7d4b1..1dce5d3b1e994a060067de4901912dd5a9be7e15 100644
|
|
--- a/src/main/java/net/minecraft/network/NetworkManager.java
|
|
+++ b/src/main/java/net/minecraft/network/NetworkManager.java
|
|
@@ -435,9 +435,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
|
|
@@ -447,7 +447,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) {
|
|
@@ -467,12 +467,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
|
|
@@ -482,7 +482,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) {
|
|
@@ -502,7 +502,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
|