Skip to content

Commit

Permalink
Make extraSyncIgnoreThresholdTicks configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
qouteall committed Nov 19, 2022
1 parent 9c151f6 commit 0814d4b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ public class IPGlobal {
public static boolean enableCrossPortalSound = true;

public static boolean sendExtraPositionSync = true;
public static int extraSyncIgnoreThresholdTicks = 100;

public static enum RenderMode {
normal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class IPConfig {
public boolean enableClientPerformanceAdjustment = true;
public boolean enableServerPerformanceAdjustment = true;
public boolean sendExtraPositionSync = true;
public int extraSyncIgnoreThresholdTicks = 100;
public IPGlobal.NetherPortalMode netherPortalMode = IPGlobal.NetherPortalMode.normal;
public IPGlobal.EndPortalMode endPortalMode = IPGlobal.EndPortalMode.normal;
// public boolean enableServerCollision = true;
Expand Down Expand Up @@ -160,6 +161,7 @@ public void onConfigChanged() {
IPGlobal.enableServerPerformanceAdjustment = enableServerPerformanceAdjustment;
IPGlobal.enableCrossPortalSound = enableCrossPortalSound;
IPGlobal.sendExtraPositionSync = sendExtraPositionSync;
IPGlobal.extraSyncIgnoreThresholdTicks = extraSyncIgnoreThresholdTicks;

if (enableDepthClampForPortalRendering) {
IPGlobal.enableDepthClampForPortalRendering = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ private void teleportPlayer(Portal portal) {
public boolean isTeleportingFrequently() {
// sometimes the round trip time is more than 1 seconds
// the client has already crossed the portal and then received the server packet telling the player is in the old place
return (tickTimeForTeleportation - lastTeleportTime <= 100) ||
return (tickTimeForTeleportation - lastTeleportTime <= IPGlobal.extraSyncIgnoreThresholdTicks) ||
(tickTimeForTeleportation <= teleportTickTimeLimit);
}

Expand Down

0 comments on commit 0814d4b

Please sign in to comment.