This patch was useless
This commit is contained in:
@@ -1,82 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
|
|
||||||
Date: Sat, 8 Jul 2023 01:23:21 +0300
|
|
||||||
Subject: [PATCH] Toggle Fix large move vector
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
|
|
||||||
index e2fb7d7a7b3126d386b46442c115085d1974ac4e..9e02bc343422b68cdaeb2e2e40b304e9c84e565c 100644
|
|
||||||
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
|
|
||||||
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
|
|
||||||
@@ -169,6 +169,7 @@ public class KaiijuWorldConfig {
|
|
||||||
public boolean fixTripWireStateInconsistency = true;
|
|
||||||
public boolean safeTeleporting = true;
|
|
||||||
public boolean sandDuplication = false;
|
|
||||||
+ public boolean fixLargeMoveVector = true;
|
|
||||||
|
|
||||||
private void gameplaySettings() {
|
|
||||||
fixVoidTrading = getBoolean("gameplay.fix-void-trading", fixVoidTrading);
|
|
||||||
@@ -176,5 +177,6 @@ public class KaiijuWorldConfig {
|
|
||||||
fixTripWireStateInconsistency = getBoolean("gameplay.fix-tripwire-state-inconsistency", fixTripWireStateInconsistency);
|
|
||||||
safeTeleporting = getBoolean("gameplay.safe-teleportation", safeTeleporting);
|
|
||||||
sandDuplication = getBoolean("gameplay.sand-duplication", sandDuplication);
|
|
||||||
+ fixLargeMoveVector = getBoolean("gameplay.fix-large-move-vector", fixLargeMoveVector);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
||||||
index c261a6c566eb24ded856a8db57623dd77339d003..b97e2c786a16ebafc8f2b5ba62ca81cceea13034 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
||||||
@@ -632,11 +632,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
|
||||||
double d7 = d4 - this.vehicleFirstGoodY;
|
|
||||||
double d8 = d5 - this.vehicleFirstGoodZ;
|
|
||||||
double d9 = entity.getDeltaMovement().lengthSqr();
|
|
||||||
+ // Kaiiju start - Toggle fix large move vector
|
|
||||||
+ double d10;
|
|
||||||
+ if (!this.player.level().kaiijuConfig.fixLargeMoveVector) d10 = d6 * d6 + d7 * d7 + d8 * d8;
|
|
||||||
+ else {
|
|
||||||
+ // Kaiiju end
|
|
||||||
// Paper start - fix large move vectors killing the server
|
|
||||||
double currDeltaX = toX - fromX;
|
|
||||||
double currDeltaY = toY - fromY;
|
|
||||||
double currDeltaZ = toZ - fromZ;
|
|
||||||
- double d10 = Math.max(d6 * d6 + d7 * d7 + d8 * d8, (currDeltaX * currDeltaX + currDeltaY * currDeltaY + currDeltaZ * currDeltaZ) - 1);
|
|
||||||
+ d10 = Math.max(d6 * d6 + d7 * d7 + d8 * d8, (currDeltaX * currDeltaX + currDeltaY * currDeltaY + currDeltaZ * currDeltaZ) - 1); // Kaiiju - Toggle fix large move vector
|
|
||||||
// Paper end - fix large move vectors killing the server
|
|
||||||
|
|
||||||
// Paper start - fix large move vectors killing the server
|
|
||||||
@@ -645,7 +650,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
|
||||||
double otherFieldZ = d5 - this.vehicleLastGoodZ;
|
|
||||||
d10 = Math.max(d10, (otherFieldX * otherFieldX + otherFieldY * otherFieldY + otherFieldZ * otherFieldZ) - 1);
|
|
||||||
// Paper end - fix large move vectors killing the server
|
|
||||||
-
|
|
||||||
+ } // Kaiiju - Toggle fix large move vector
|
|
||||||
// CraftBukkit start - handle custom speeds and skipped ticks
|
|
||||||
int currTick = (int)(Util.getMillis() / 50); // Folia - region threading
|
|
||||||
this.allowedPlayerTicks += currTick - this.lastTick; // Folia - region threading
|
|
||||||
@@ -1467,11 +1472,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
|
||||||
double d7 = d1 - this.firstGoodY;
|
|
||||||
double d8 = d2 - this.firstGoodZ;
|
|
||||||
double d9 = this.player.getDeltaMovement().lengthSqr();
|
|
||||||
+ // Kaiiju start - Toggle fix large move vector
|
|
||||||
+ double d10;
|
|
||||||
+ if (!this.player.level().kaiijuConfig.fixLargeMoveVector) d10 = d6 * d6 + d7 * d7 + d8 * d8;
|
|
||||||
+ else {
|
|
||||||
+ // Kaiiju end
|
|
||||||
// Paper start - fix large move vectors killing the server
|
|
||||||
double currDeltaX = toX - prevX;
|
|
||||||
double currDeltaY = toY - prevY;
|
|
||||||
double currDeltaZ = toZ - prevZ;
|
|
||||||
- double d10 = Math.max(d6 * d6 + d7 * d7 + d8 * d8, (currDeltaX * currDeltaX + currDeltaY * currDeltaY + currDeltaZ * currDeltaZ) - 1);
|
|
||||||
+ d10 = Math.max(d6 * d6 + d7 * d7 + d8 * d8, (currDeltaX * currDeltaX + currDeltaY * currDeltaY + currDeltaZ * currDeltaZ) - 1); // Kaiiju - Toggle fix large move vector
|
|
||||||
// Paper end - fix large move vectors killing the server
|
|
||||||
// Paper start - fix large move vectors killing the server
|
|
||||||
double otherFieldX = d0 - this.lastGoodX;
|
|
||||||
@@ -1479,6 +1489,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
|
||||||
double otherFieldZ = d2 - this.lastGoodZ;
|
|
||||||
d10 = Math.max(d10, (otherFieldX * otherFieldX + otherFieldY * otherFieldY + otherFieldZ * otherFieldZ) - 1);
|
|
||||||
// Paper end - fix large move vectors killing the server
|
|
||||||
+ } // Kaiiju - Toggle fix large move vector
|
|
||||||
|
|
||||||
if (this.player.isSleeping()) {
|
|
||||||
if (d10 > 1.0D) {
|
|
||||||
Reference in New Issue
Block a user