Skip to content

Commit

Permalink
Add Linear region format warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Apr 24, 2024
1 parent 4927109 commit c1dbd8c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
12 changes: 7 additions & 5 deletions patches/server/0054-LinearPurpur-Add-Linear-region-format.patch
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ index 0c8bcfbe35f9133a32a31163e5bf2f04786c77a0..63b5a0993207c55357ac507c974dea77
private static void disableGiveCommandDrops() {
disableGiveCommandDrops = getBoolean("settings.disable-give-dropping", disableGiveCommandDrops);
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index d37bc0dde078c2246474eadd19f6ebcc2a06fb17..e36059ceb31a5b852af0782181e16c1a1309e105 100644
index d37bc0dde078c2246474eadd19f6ebcc2a06fb17..99fed6e959d62082e7922aa95da614f8ce776838 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -27,6 +27,7 @@ import java.util.Map;
Expand All @@ -684,7 +684,7 @@ index d37bc0dde078c2246474eadd19f6ebcc2a06fb17..e36059ceb31a5b852af0782181e16c1a

@SuppressWarnings("unused")
public class PurpurWorldConfig {
@@ -118,6 +119,30 @@ public class PurpurWorldConfig {
@@ -118,6 +119,32 @@ public class PurpurWorldConfig {
arrowMovementResetsDespawnCounter = getBoolean("gameplay-mechanics.arrow.movement-resets-despawn-counter", arrowMovementResetsDespawnCounter);
}

Expand All @@ -699,14 +699,16 @@ index d37bc0dde078c2246474eadd19f6ebcc2a06fb17..e36059ceb31a5b852af0782181e16c1a
+ log(Level.SEVERE, "Falling back to ANVIL region file format.");
+ regionFormatName = RegionFileFormat.ANVIL;
+ }
+ if (regionFormatName.equals(RegionFileFormat.LINEAR)) {
+ log(Level.SEVERE, "You should not use Linear region format! It will break your chunks due to its design flaw!!");
+ log(Level.SEVERE, "Linear region format feature will be removed in Leaf 1.20.5, so you need to use https://github.com/xymb-endcrystalme/LinearRegionFileFormatTools");
+ log(Level.SEVERE, "to convert your world back to vanilla ANVIL format.");
+ }
+ regionFormatLinearCompressionLevel = getInt("region-format.linear.compression-level", regionFormatLinearCompressionLevel);
+ if (regionFormatLinearCompressionLevel > 23 || regionFormatLinearCompressionLevel < 1) {
+ log(Level.SEVERE, "Linear region compression level should be between 1 and 22 in purpur.yml: " + regionFormatLinearCompressionLevel);
+ log(Level.SEVERE, "Falling back to compression level 1.");
+ regionFormatLinearCompressionLevel = 1;
+ } else if (regionFormatLinearCompressionLevel > 1) {
+ // Dreeam TODO - This should become comment after switching to Leaf world config
+ log(Level.SEVERE, "WARNING: DO NOT USE TOO HIGH COMPRESSION LEVEL (Recommended is 1 which is default value if you are using linear). BECAUSE THAT WOULD MAKE YOUR CHUNK DATA IN DANGER!");
+ }
+ linearCrashOnBrokenSymlink = getBoolean("region-format.linear.crash-on-broken-symlink", linearCrashOnBrokenSymlink);
+ }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ index 63b5a0993207c55357ac507c974dea77206e80f4..e45c11bf2c42e6d57f803349d8ca6936
org.bukkit.event.inventory.InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27);
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index e36059ceb31a5b852af0782181e16c1a1309e105..af6190075cc0ffa6e8473491186e7a7958376d59 100644
index 99fed6e959d62082e7922aa95da614f8ce776838..4a863e33be9673a57b1edbdd51220fabbd9812ed 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -1193,7 +1193,15 @@ public class PurpurWorldConfig {
@@ -1195,7 +1195,15 @@ public class PurpurWorldConfig {
public boolean allayRidableInWater = true;
public boolean allayControllable = true;
public List<String> allayRespectNBT = new ArrayList<>();
Expand All @@ -228,7 +228,7 @@ index e36059ceb31a5b852af0782181e16c1a1309e105..af6190075cc0ffa6e8473491186e7a79
allayRidable = getBoolean("mobs.allay.ridable", allayRidable);
allayRidableInWater = getBoolean("mobs.allay.ridable-in-water", allayRidableInWater);
allayControllable = getBoolean("mobs.allay.controllable", allayControllable);
@@ -1312,7 +1320,15 @@ public class PurpurWorldConfig {
@@ -1314,7 +1322,15 @@ public class PurpurWorldConfig {
public double camelMovementSpeedMin = 0.09D;
public double camelMovementSpeedMax = 0.09D;
public int camelBreedingTicks = 6000;
Expand All @@ -244,7 +244,7 @@ index e36059ceb31a5b852af0782181e16c1a1309e105..af6190075cc0ffa6e8473491186e7a79
camelRidableInWater = getBoolean("mobs.camel.ridable-in-water", camelRidableInWater);
camelMaxHealthMin = getDouble("mobs.camel.attributes.max_health.min", camelMaxHealthMin);
camelMaxHealthMax = getDouble("mobs.camel.attributes.max_health.max", camelMaxHealthMax);
@@ -1742,7 +1758,15 @@ public class PurpurWorldConfig {
@@ -1744,7 +1760,15 @@ public class PurpurWorldConfig {
public boolean frogControllable = true;
public float frogRidableJumpHeight = 0.65F;
public int frogBreedingTicks = 6000;
Expand All @@ -260,7 +260,7 @@ index e36059ceb31a5b852af0782181e16c1a1309e105..af6190075cc0ffa6e8473491186e7a79
frogRidable = getBoolean("mobs.frog.ridable", frogRidable);
frogRidableInWater = getBoolean("mobs.frog.ridable-in-water", frogRidableInWater);
frogControllable = getBoolean("mobs.frog.controllable", frogControllable);
@@ -2688,7 +2712,13 @@ public class PurpurWorldConfig {
@@ -2690,7 +2714,13 @@ public class PurpurWorldConfig {
public boolean snifferControllable = true;
public double snifferMaxHealth = 14.0D;
public int snifferBreedingTicks = 6000;
Expand All @@ -274,7 +274,7 @@ index e36059ceb31a5b852af0782181e16c1a1309e105..af6190075cc0ffa6e8473491186e7a79
snifferRidable = getBoolean("mobs.sniffer.ridable", snifferRidable);
snifferRidableInWater = getBoolean("mobs.sniffer.ridable-in-water", snifferRidableInWater);
snifferControllable = getBoolean("mobs.sniffer.controllable", snifferControllable);
@@ -2787,7 +2817,15 @@ public class PurpurWorldConfig {
@@ -2789,7 +2819,15 @@ public class PurpurWorldConfig {
public boolean tadpoleRidable = false;
public boolean tadpoleRidableInWater = true;
public boolean tadpoleControllable = true;
Expand All @@ -290,7 +290,7 @@ index e36059ceb31a5b852af0782181e16c1a1309e105..af6190075cc0ffa6e8473491186e7a79
tadpoleRidable = getBoolean("mobs.tadpole.ridable", tadpoleRidable);
tadpoleRidableInWater = getBoolean("mobs.tadpole.ridable-in-water", tadpoleRidableInWater);
tadpoleControllable = getBoolean("mobs.tadpole.controllable", tadpoleControllable);
@@ -3003,7 +3041,15 @@ public class PurpurWorldConfig {
@@ -3005,7 +3043,15 @@ public class PurpurWorldConfig {
public boolean wardenRidable = false;
public boolean wardenRidableInWater = true;
public boolean wardenControllable = true;
Expand Down

0 comments on commit c1dbd8c

Please sign in to comment.