PaperPR - Projectile load/save limit per chunk

- Dropped "Add option to disable saving projectiles to disk" in favor of the above patch
 - Config migration is automatic. If "gameplay-mechanics.save-projectiles-to-disk" was set to false in purpur.yml, "projectile-load-save-per-chunk-limit" will be set to 0 in paper.yml (resulting in unchanged behaviour)
This commit is contained in:
jmp
2020-11-30 19:38:23 -08:00
parent 61d72c768d
commit 7174d63c4e
83 changed files with 522 additions and 436 deletions

View File

@@ -0,0 +1,65 @@
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 7a2a8acea9..8a452173c0 100644
--- a/src/main/java/net/minecraft/server/NetworkManager.java
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
@@ -392,9 +392,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
@@ -404,7 +404,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) {
@@ -424,12 +424,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
@@ -439,7 +439,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) {
@@ -459,7 +459,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