9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-30 20:39:15 +00:00
This commit is contained in:
violetc
2023-07-04 14:04:50 +08:00
parent a739180363
commit bd1e9af3ea
2 changed files with 50 additions and 2 deletions

View File

@@ -128,10 +128,10 @@ index a53514f2c510b29f596c361de7bc0b405c27e964..269c7ba0707db4fdc45a70000e0be892
.withRequiredArg()
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..6bff943bc8c600a13d20d625fe3d49909f523cac
index 0000000000000000000000000000000000000000..5873e0c0c41aea52abc7795f49f7a97f613fa1a4
--- /dev/null
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -0,0 +1,792 @@
@@ -0,0 +1,797 @@
+package top.leavesmc.leaves;
+
+import com.destroystokyo.paper.util.SneakyThrow;
@@ -749,6 +749,11 @@ index 0000000000000000000000000000000000000000..6bff943bc8c600a13d20d625fe3d4990
+ msptSyncProtocol = getBoolean("settings.protocol.bladeren.mspt-sync-protocol", msptSyncProtocol);
+ }
+
+ public static boolean fixPaper9372 = true;
+ private static void fixPaper9372() {
+ fixPaper9372 = getBoolean("settings.performance.fix.fix-paper-9372", fixPaper9372);
+ }
+
+ public static final class WorldConfig {
+
+ public final String worldName;

View File

@@ -0,0 +1,43 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Tue, 4 Jul 2023 14:03:03 +0800
Subject: [PATCH] Fix Paper#9372
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 246afa286ae66788c45b6c58108ff200bbb92f6b..0d0479be19afd82a876b8a4a5eda86d7f6710452 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1252,6 +1252,7 @@ public class ServerPlayer extends Player {
this.setServerLevel(worldserver);
this.connection.teleport(exit); // CraftBukkit - use internal teleport without event
this.connection.resetPosition();
+ if (top.leavesmc.leaves.LeavesConfig.fixPaper9372) this.mainSupportingBlockPos = Optional.empty(); // Leaves - fix paper 9372
worldserver.addDuringPortalTeleport(this);
worldserver1.getProfiler().pop();
this.triggerDimensionChangeTriggers(worldserver1);
@@ -1963,6 +1964,7 @@ public class ServerPlayer extends Player {
public void moveTo(double x, double y, double z) {
super.moveTo(x, y, z);
this.connection.resetPosition();
+ if (top.leavesmc.leaves.LeavesConfig.fixPaper9372) this.mainSupportingBlockPos = Optional.empty(); // Leaves - fix paper 9372
}
@Override
@@ -2199,6 +2201,7 @@ public class ServerPlayer extends Player {
this.connection.send(new ClientboundSetCameraPacket(this.camera));
this.connection.resetPosition();
+ if (top.leavesmc.leaves.LeavesConfig.fixPaper9372) this.mainSupportingBlockPos = Optional.empty(); // Leaves - fix paper 9372
}
}
@@ -2651,6 +2654,7 @@ public class ServerPlayer extends Player {
public void forceSetPositionRotation(double x, double y, double z, float yaw, float pitch) {
this.moveTo(x, y, z, yaw, pitch);
this.connection.resetPosition();
+ if (top.leavesmc.leaves.LeavesConfig.fixPaper9372) this.mainSupportingBlockPos = Optional.empty(); // Leaves - fix paper 9372
}
@Override