aboutsummaryrefslogtreecommitdiffhomepage
path: root/paper-server
diff options
context:
space:
mode:
authorLulu13022002 <[email protected]>2024-12-20 21:22:58 +0100
committerLulu13022002 <[email protected]>2024-12-20 21:22:58 +0100
commit2213ce5bbccbb8a466c394eff31091a2cabe2f1b (patch)
treeabc6ad799d6b176bbc6b3a4f642558da5946f011 /paper-server
parent86378c66b3d71cc91722d9464260a991d6ab1142 (diff)
downloadPaper-2213ce5bbccbb8a466c394eff31091a2cabe2f1b.tar.gz
Paper-2213ce5bbccbb8a466c394eff31091a2cabe2f1b.zip
fix enderpearl across portals
Diffstat (limited to 'paper-server')
-rw-r--r--paper-server/patches/features/0021-Moonrise-optimisation-patches.patch5
-rw-r--r--paper-server/patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch14
-rw-r--r--paper-server/patches/sources/net/minecraft/world/entity/Entity.java.patch6
3 files changed, 13 insertions, 12 deletions
diff --git a/paper-server/patches/features/0021-Moonrise-optimisation-patches.patch b/paper-server/patches/features/0021-Moonrise-optimisation-patches.patch
index 01488729ee..491cf50e1c 100644
--- a/paper-server/patches/features/0021-Moonrise-optimisation-patches.patch
+++ b/paper-server/patches/features/0021-Moonrise-optimisation-patches.patch
@@ -22768,7 +22768,7 @@ index 0000000000000000000000000000000000000000..689ce367164e79e0426eeecb81dbbc52
+ private SaveUtil() {}
+}
diff --git a/io/papermc/paper/FeatureHooks.java b/io/papermc/paper/FeatureHooks.java
-index e40b83502c74d7dcae05d9d0c865affeee186893..c4ddf4b6fee8086481581fab88a807f63e211b5c 100644
+index 184e6c6fe2ba522d0ea0774604839320c4152371..b329eb069f5b3d4f33a94d2045cb8f250d2a5684 100644
--- a/io/papermc/paper/FeatureHooks.java
+++ b/io/papermc/paper/FeatureHooks.java
@@ -1,6 +1,8 @@
@@ -22946,6 +22946,7 @@ index e40b83502c74d7dcae05d9d0c865affeee186893..c4ddf4b6fee8086481581fab88a807f6
}
}
+\ No newline at end of file
diff --git a/io/papermc/paper/command/subcommands/ChunkDebugCommand.java b/io/papermc/paper/command/subcommands/ChunkDebugCommand.java
new file mode 100644
index 0000000000000000000000000000000000000000..2dca7afbd93cfbb8686f336fcd3b45dd01fba0fc
@@ -28341,7 +28342,7 @@ index 8cc5c0716392ba06501542ff5cbe71ee43979e5d..09fd99c9cbd23b5f3c899bfb00c9b896
+ // Paper end - block counting
}
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
-index d5b0db3095a563dd101a1b12b150401a7dc59f8e..997158b88a2ac8fc3b40589e615f85fd8e42d146 100644
+index 069d0d0ddeceb0de2300a3354fed218407d88938..3fd7f6bcdeff271a9843b2f2454f92d92069f539 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -135,7 +135,7 @@ import net.minecraft.world.scores.ScoreHolder;
diff --git a/paper-server/patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch b/paper-server/patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch
index fbea2e5964..565e6dcb4b 100644
--- a/paper-server/patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch
+++ b/paper-server/patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch
@@ -167,7 +167,7 @@
this.player.setLastClientInput(packet.input());
}
-@@ -390,25 +_,84 @@
+@@ -390,17 +_,29 @@
public void handleMoveVehicle(ServerboundMoveVehiclePacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (containsInvalidValues(packet.position().x(), packet.position().y(), packet.position().z(), packet.yRot(), packet.xRot())) {
@@ -201,23 +201,21 @@
float f = Mth.wrapDegrees(packet.yRot());
float f1 = Mth.wrapDegrees(packet.xRot());
double d3 = d - this.vehicleFirstGoodX;
- double d4 = d1 - this.vehicleFirstGoodY;
+@@ -408,7 +_,53 @@
double d5 = d2 - this.vehicleFirstGoodZ;
double d6 = rootVehicle.getDeltaMovement().lengthSqr();
-- double d7 = d3 * d3 + d4 * d4 + d5 * d5;
+ double d7 = d3 * d3 + d4 * d4 + d5 * d5;
- if (d7 - d6 > 100.0 && !this.isSingleplayerOwner()) {
-+ double d7 = d3 * d3 + d4 * d4 + d5 * d5; final double vehicleFirstGoodDistanceSquared = d7; // Paper - OBFHELPER
+ // Paper start - fix large move vectors killing the server
+ double currDeltaX = toX - x;
+ double currDeltaY = toY - y;
+ double currDeltaZ = toZ - z;
-+ double d10 = Math.max(vehicleFirstGoodDistanceSquared, (currDeltaX * currDeltaX + currDeltaY * currDeltaY + currDeltaZ * currDeltaZ) - 1);
++ d7 = Math.max(d7, (currDeltaX * currDeltaX + currDeltaY * currDeltaY + currDeltaZ * currDeltaZ) - 1);
+ double otherFieldX = d3 - this.vehicleLastGoodX;
+ double otherFieldY = d4 - this.vehicleLastGoodY;
+ double otherFieldZ = d5 - this.vehicleLastGoodZ;
-+ d10 = Math.max(d10, (otherFieldX * otherFieldX + otherFieldY * otherFieldY + otherFieldZ * otherFieldZ) - 1);
++ d7 = Math.max(d7, (otherFieldX * otherFieldX + otherFieldY * otherFieldY + otherFieldZ * otherFieldZ) - 1);
+ // Paper end - fix large move vectors killing the server
-+ //if (d7 - d6 > 100.0 && !this.isSingleplayerOwner()) {
+
+ // CraftBukkit start - handle custom speeds and skipped ticks
+ this.allowedPlayerTicks += (System.currentTimeMillis() / 50) - this.lastTick;
@@ -231,7 +229,7 @@
+ i = 1;
+ }
+
-+ if (d10 > 0) {
++ if (d7 > 0) {
+ this.allowedPlayerTicks -= 1;
+ } else {
+ this.allowedPlayerTicks = 20;
diff --git a/paper-server/patches/sources/net/minecraft/world/entity/Entity.java.patch b/paper-server/patches/sources/net/minecraft/world/entity/Entity.java.patch
index 6bd4be5cfe..6bbcc9ce75 100644
--- a/paper-server/patches/sources/net/minecraft/world/entity/Entity.java.patch
+++ b/paper-server/patches/sources/net/minecraft/world/entity/Entity.java.patch
@@ -1119,15 +1119,17 @@
}
protected boolean canAddPassenger(Entity passenger) {
-@@ -2295,7 +_,7 @@
+@@ -2295,8 +_,8 @@
TeleportTransition portalDestination = this.portalProcess.getPortalDestination(serverLevel, this);
if (portalDestination != null) {
ServerLevel level = portalDestination.newLevel();
- if (serverLevel.getServer().isLevelEnabled(level)
+- && (level.dimension() == serverLevel.dimension() || this.canTeleport(serverLevel, level))) {
+ if (this instanceof ServerPlayer // CraftBukkit - always call event for players
- && (level.dimension() == serverLevel.dimension() || this.canTeleport(serverLevel, level))) {
++ || (level != null && (level.dimension() == serverLevel.dimension() || this.canTeleport(serverLevel, level)))) { // CraftBukkit
this.teleport(portalDestination);
}
+ }
@@ -2377,7 +_,7 @@
}