aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0464-Hide-sync-chunk-writes-behind-flag.patch
blob: 71a50c1e91095537e6195404cc9b31494c67c6c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Fri, 26 Jun 2020 22:35:08 -0700
Subject: [PATCH] Hide sync chunk writes behind flag

Syncing writes on each write call has terrible performance
on harddrives.

-DPaper.enable-sync-chunk-writes=true to enable

diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
index 12e55aabf0daf341ec74688e79c43451e820e6dc..0544ac93513d3a274bfb53bb6120bd598f4d603b 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -108,7 +108,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
         this.maxWorldSize = this.get("max-world-size", (integer) -> {
             return Mth.clamp(integer, 1, 29999984);
         }, 29999984);
-        this.syncChunkWrites = this.get("sync-chunk-writes", true);
+        this.syncChunkWrites = this.get("sync-chunk-writes", true) && Boolean.getBoolean("Paper.enable-sync-chunk-writes"); // Paper - hide behind flag
         this.enableJmxMonitoring = this.get("enable-jmx-monitoring", false);
         this.enableStatus = this.get("enable-status", true);
         this.entityBroadcastRangePercentage = this.get("entity-broadcast-range-percentage", (integer) -> {