mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-08 16:12:18 -07:00
Implement config hooks in PaperHooks
This commit is contained in:
@@ -91,9 +91,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+
|
||||
+ public int configPlayerMaxConcurrentGens();
|
||||
+
|
||||
+ public long configAutoSaveInterval();
|
||||
+ public long configAutoSaveInterval(final ServerLevel world);
|
||||
+
|
||||
+ public int configMaxAutoSavePerTick();
|
||||
+ public int configMaxAutoSavePerTick(final ServerLevel world);
|
||||
+
|
||||
+ public boolean configFixMC159283();
|
||||
+
|
||||
@@ -1153,42 +1153,42 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean configAutoConfigSendDistance() {
|
||||
+
|
||||
+ return io.papermc.paper.configuration.GlobalConfiguration.get().chunkLoadingAdvanced.autoConfigSendDistance;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public double configPlayerMaxLoadRate() {
|
||||
+
|
||||
+ return io.papermc.paper.configuration.GlobalConfiguration.get().chunkLoadingBasic.playerMaxChunkLoadRate;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public double configPlayerMaxGenRate() {
|
||||
+
|
||||
+ return io.papermc.paper.configuration.GlobalConfiguration.get().chunkLoadingBasic.playerMaxChunkGenerateRate;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public double configPlayerMaxSendRate() {
|
||||
+
|
||||
+ return io.papermc.paper.configuration.GlobalConfiguration.get().chunkLoadingBasic.playerMaxChunkSendRate;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int configPlayerMaxConcurrentLoads() {
|
||||
+
|
||||
+ return io.papermc.paper.configuration.GlobalConfiguration.get().chunkLoadingAdvanced.playerMaxConcurrentChunkLoads;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int configPlayerMaxConcurrentGens() {
|
||||
+
|
||||
+ return io.papermc.paper.configuration.GlobalConfiguration.get().chunkLoadingAdvanced.playerMaxConcurrentChunkGenerates;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public long configAutoSaveInterval() {
|
||||
+
|
||||
+ public long configAutoSaveInterval(final ServerLevel world) {
|
||||
+ return world.paperConfig().chunks.autoSaveInterval.value();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int configMaxAutoSavePerTick() {
|
||||
+
|
||||
+ public int configMaxAutoSavePerTick(final ServerLevel world) {
|
||||
+ return world.paperConfig().chunks.maxAutoSaveChunksPerTick;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
|
@@ -7019,8 +7019,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ public void autoSave() {
|
||||
+ final List<NewChunkHolder> reschedule = new ArrayList<>();
|
||||
+ final long currentTick = this.currentTick;
|
||||
+ final long maxSaveTime = currentTick - Math.max(1L, PlatformHooks.get().configAutoSaveInterval());
|
||||
+ final int maxToSave = PlatformHooks.get().configMaxAutoSavePerTick();
|
||||
+ final long maxSaveTime = currentTick - Math.max(1L, PlatformHooks.get().configAutoSaveInterval(this.world));
|
||||
+ final int maxToSave = PlatformHooks.get().configMaxAutoSavePerTick(this.world);
|
||||
+ for (int autoSaved = 0; autoSaved < maxToSave && !this.autoSaveQueue.isEmpty();) {
|
||||
+ final NewChunkHolder holder = this.autoSaveQueue.first();
|
||||
+
|
||||
|
Reference in New Issue
Block a user