mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 20:52:12 -07:00
Implement config hooks in PaperHooks
This commit is contained in:
@@ -3,16 +3,8 @@ https://github.com/Tuinity/Moonrise/compare/6a2c6d27df11d417c1fefa749109d8e87599
|
||||
need to compare the diffs
|
||||
|
||||
|
||||
add notes to moonrise patch:
|
||||
- implemented fast palette patch
|
||||
- implemented better bitstorage magic patch
|
||||
- implemented blockstate property patch (replaced old paper one)
|
||||
- implemented fluid patch
|
||||
|
||||
|
||||
todo:
|
||||
- double check that the misc changes commit on dev/1.21.2 moonrise is applied
|
||||
- implement platformhooks
|
||||
- in ChunkEntitySlices, implement modifySavedEntities() by copying from old
|
||||
- implement PlayerChunkUnloadEvent in PlatformHooks#onChunkUnWatch
|
||||
- make sure chunk pos is passed in PlatformHooks#postLoadProtoChunk
|
||||
@@ -32,5 +24,4 @@ todo:
|
||||
- implement starlight.ChunkSerializerMixin diff from reference
|
||||
- implement starlight.SerializableChunkData$SectionData diff from reference
|
||||
- implement starlight.SerializableChunkDataMixin diff from reference
|
||||
- unfuck the chtunk system config diff
|
||||
- chunk system: move get entity lookup reroute into the folia scheduler api patch
|
||||
|
@@ -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