This repository has been archived by the owner on Jun 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
125 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: IPECTER <ipectert@gmail.com> | ||
Date: Thu, 24 Nov 2022 19:51:18 +0900 | ||
Subject: [PATCH] EVDS | ||
|
||
|
||
diff --git a/src/main/java/io/papermc/paper/chunk/PlayerChunkLoader.java b/src/main/java/io/papermc/paper/chunk/PlayerChunkLoader.java | ||
index 0b060183429f4c72ec767075538477b4302bbf0d..eaeac11dbe777e078c753f658520aa100b298fbb 100644 | ||
--- a/src/main/java/io/papermc/paper/chunk/PlayerChunkLoader.java | ||
+++ b/src/main/java/io/papermc/paper/chunk/PlayerChunkLoader.java | ||
@@ -31,10 +31,10 @@ import java.util.concurrent.atomic.AtomicInteger; | ||
public final class PlayerChunkLoader { | ||
|
||
public static final int MIN_VIEW_DISTANCE = 2; | ||
- public static final int MAX_VIEW_DISTANCE = 32; | ||
+ public static final int MAX_VIEW_DISTANCE = 48; // Fusion - ExtendViewDistanceSystem: Increase Max Distance | ||
|
||
- public static final int TICK_TICKET_LEVEL = 31; | ||
- public static final int LOADED_TICKET_LEVEL = 33; | ||
+ public static final int TICK_TICKET_LEVEL = 47; // Fusion - ExtendViewDistanceSystem: Increase Max Distance | ||
+ public static final int LOADED_TICKET_LEVEL = 49; // Fusion - ExtendViewDistanceSystem: Increase Max Distance | ||
|
||
public static int getTickViewDistance(final Player player) { | ||
return getTickViewDistance(((CraftPlayer)player).getHandle()); | ||
diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java | ||
index 830d863cd9665d58875bfa5ca2bcd22f89ab2d49..6edead8af484429e0bc0419b6c3843072e6e0d08 100644 | ||
--- a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java | ||
+++ b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java | ||
@@ -57,9 +57,9 @@ public final class ChunkHolderManager { | ||
|
||
private static final Logger LOGGER = LogUtils.getClassLogger(); | ||
|
||
- public static final int FULL_LOADED_TICKET_LEVEL = 33; | ||
- public static final int BLOCK_TICKING_TICKET_LEVEL = 32; | ||
- public static final int ENTITY_TICKING_TICKET_LEVEL = 31; | ||
+ public static final int FULL_LOADED_TICKET_LEVEL = 49; // Fusion - ExtendViewDistanceSystem: Increase Max Distance | ||
+ public static final int BLOCK_TICKING_TICKET_LEVEL = 48; // Fusion - ExtendViewDistanceSystem: Increase Max Distance | ||
+ public static final int ENTITY_TICKING_TICKET_LEVEL = 47; // Fusion - ExtendViewDistanceSystem: Increase Max Distance | ||
public static final int MAX_TICKET_LEVEL = ChunkMap.MAX_CHUNK_DISTANCE; // inclusive | ||
|
||
private static final long NO_TIMEOUT_MARKER = -1L; | ||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java | ||
index ceaa44e8fbf02aef36f5ae663269dfc1026e4086..31bcd4b489b535cc04fffcef71ccd6ca923663d5 100644 | ||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java | ||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java | ||
@@ -122,9 +122,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider | ||
private static final int CHUNK_SAVED_EAGERLY_PER_TICK = 20; | ||
private static final int EAGER_CHUNK_SAVE_COOLDOWN_IN_MILLIS = 10000; | ||
private static final int MIN_VIEW_DISTANCE = 3; | ||
- public static final int MAX_VIEW_DISTANCE = 33; | ||
- public static final int MAX_CHUNK_DISTANCE = 33 + ChunkStatus.maxDistance(); | ||
- public static final int FORCED_TICKET_LEVEL = 31; | ||
+ public static final int MAX_VIEW_DISTANCE = 49; // Fusion - ExtendViewDistanceSystem: Increase Max Distance | ||
+ public static final int MAX_CHUNK_DISTANCE = 49 + ChunkStatus.maxDistance(); // Fusion - ExtendViewDistanceSystem: Increase Max Distance | ||
+ public static final int FORCED_TICKET_LEVEL = 47; // Fusion - ExtendViewDistanceSystem: Increase Max Distance | ||
// Paper - rewrite chunk system | ||
public final ServerLevel level; | ||
private final ThreadedLevelLightEngine lightEngine; | ||
@@ -688,7 +688,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider | ||
|
||
protected void releaseLightTicket(ChunkPos pos) { | ||
this.mainThreadExecutor.tell(Util.name(() -> { | ||
- this.distanceManager.removeTicket(TicketType.LIGHT, pos, 33 + ChunkStatus.getDistance(ChunkStatus.LIGHT), pos); | ||
+ this.distanceManager.removeTicket(TicketType.LIGHT, pos, 49 + ChunkStatus.getDistance(ChunkStatus.LIGHT), pos); // Fusion - ExtendViewDistanceSystem: Increase Max Distance | ||
}, () -> { | ||
return "release light ticket " + pos; | ||
})); | ||
@@ -805,7 +805,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider | ||
} | ||
// Paper end - replace player loader system | ||
public void setViewDistance(int watchDistance) { | ||
- int j = Mth.clamp(watchDistance + 1, (int) 3, (int) 33); | ||
+ int j = Mth.clamp(watchDistance + 1, (int) 3, (int) 49); // Fusion - ExtendViewDistanceSystem: Increase Max Distance | ||
|
||
if (j != this.viewDistance) { | ||
int k = this.viewDistance; | ||
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java | ||
index 52cba8f68d274cce106304aef1249a95474d3238..0744eb2c789132b957bf8441cfd5e3ce62450915 100644 | ||
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java | ||
+++ b/src/main/java/net/minecraft/server/level/DistanceManager.java | ||
@@ -48,10 +48,10 @@ public abstract class DistanceManager { | ||
|
||
static final Logger LOGGER = LogUtils.getLogger(); | ||
private static final int ENTITY_TICKING_RANGE = 2; | ||
- static final int PLAYER_TICKET_LEVEL = 33 + ChunkStatus.getDistance(ChunkStatus.FULL) - 2; | ||
+ static final int PLAYER_TICKET_LEVEL = 49 + ChunkStatus.getDistance(ChunkStatus.FULL) - 2; // Fusion - ExtendViewDistanceSystem: Increase Max Distance | ||
private static final int INITIAL_TICKET_LIST_CAPACITY = 4; | ||
- private static final int ENTITY_TICKING_LEVEL_THRESHOLD = 32; | ||
- private static final int BLOCK_TICKING_LEVEL_THRESHOLD = 33; | ||
+ private static final int ENTITY_TICKING_LEVEL_THRESHOLD = 47; // Fusion - ExtendViewDistanceSystem: Increase Max Distance | ||
+ private static final int BLOCK_TICKING_LEVEL_THRESHOLD = 49; // Fusion - ExtendViewDistanceSystem: Increase Max Distance | ||
final Long2ObjectMap<ObjectSet<ServerPlayer>> playersPerChunk = new Long2ObjectOpenHashMap(); | ||
// Paper - rewrite chunk system | ||
public static final int MOB_SPAWN_RANGE = 8; // private final DistanceManager.FixedPlayerDistanceChunkTracker naturalSpawnChunkCounter = new DistanceManager.FixedPlayerDistanceChunkTracker(8); // Paper - no longer used | ||
@@ -109,7 +109,7 @@ public abstract class DistanceManager { | ||
} | ||
|
||
public <T> boolean addRegionTicketAtDistance(TicketType<T> tickettype, ChunkPos chunkcoordintpair, int i, T t0) { | ||
- return this.getChunkHolderManager().addTicketAtLevel(tickettype, chunkcoordintpair, 33 - i, t0); // Paper - rewrite chunk system | ||
+ return this.getChunkHolderManager().addTicketAtLevel(tickettype, chunkcoordintpair, 49 - i, t0); // Paper - rewrite chunk system // Fusion - ExtendViewDistanceSystem: Increase Max Distance | ||
} | ||
|
||
public <T> void removeRegionTicket(TicketType<T> type, ChunkPos pos, int radius, T argument) { | ||
@@ -118,13 +118,13 @@ public abstract class DistanceManager { | ||
} | ||
|
||
public <T> boolean removeRegionTicketAtDistance(TicketType<T> tickettype, ChunkPos chunkcoordintpair, int i, T t0) { | ||
- return this.getChunkHolderManager().removeTicketAtLevel(tickettype, chunkcoordintpair, 33 - i, t0); // Paper - rewrite chunk system | ||
+ return this.getChunkHolderManager().removeTicketAtLevel(tickettype, chunkcoordintpair, 49 - i, t0); // Paper - rewrite chunk system // Fusion - ExtendViewDistanceSystem: Increase Max Distance | ||
} | ||
|
||
// Paper - rewrite chunk system | ||
|
||
protected void updateChunkForced(ChunkPos pos, boolean forced) { | ||
- Ticket<ChunkPos> ticket = new Ticket<>(TicketType.FORCED, 31, pos, 0L); // Paper - rewrite chunk system | ||
+ Ticket<ChunkPos> ticket = new Ticket<>(TicketType.FORCED, 47, pos, 0L); // Paper - rewrite chunk system // Fusion - ExtendViewDistanceSystem: Increase Max Distance | ||
long i = pos.toLong(); | ||
|
||
if (forced) { |