mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 17:07:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 7232d8f2a EntityLoadCrossbowEvent#shouldConsumeItem 4740bd6c8 Mark PlayerInventory#getItem as nullable bd9ace578 Add a config option to limit the number of entities of each type to load/save in a chunk (#4792) 6bafeb5a9 Move logic from last patch into correct place 9668118fd disable entity ticking flag after watchdog obliteration
67 lines
3.2 KiB
Diff
67 lines
3.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: jmp <jasonpenilla2@me.com>
|
|
Date: Mon, 30 Nov 2020 18:30:13 -0800
|
|
Subject: [PATCH] Config migration: disable saving projectiles to disk ->
|
|
projectile load/save limit of 0
|
|
|
|
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
index 9294bfab12ef88690e359ff90551c5c615cdd3dd..e928716d7a2dcb390507b746763e6f7eaae241b5 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
@@ -1,6 +1,7 @@
|
|
package net.pl3x.purpur;
|
|
|
|
import co.aikar.timings.TimingsManager;
|
|
+import com.destroystokyo.paper.PaperConfig;
|
|
import com.google.common.base.Throwables;
|
|
import net.minecraft.server.EntitySize;
|
|
import net.minecraft.server.EntityTypes;
|
|
@@ -132,6 +133,17 @@ public class PurpurConfig {
|
|
return config.getString(path, config.getString(path));
|
|
}
|
|
|
|
+ private static void migrateDisableProjectileSaving() {
|
|
+ if (PurpurConfig.version < 6) {
|
|
+ final boolean saveProjectilesToDisk = getBoolean("world-settings.default.gameplay-mechanics.save-projectiles-to-disk", true);
|
|
+ set("world-settings.default.gameplay-mechanics.save-projectiles-to-disk", null);
|
|
+ if (!saveProjectilesToDisk) {
|
|
+ PaperConfig.config.set("world-settings.default.projectile-load-save-per-chunk-limit", 0);
|
|
+ PaperConfig.saveConfig();
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+
|
|
public static String afkBroadcastAway = "§e§o%s is now AFK";
|
|
public static String afkBroadcastBack = "§e§o%s is no longer AFK";
|
|
public static String afkTabListPrefix = "[AFK] ";
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 472db0b81c6b072941a64d2e2f0cf2aebd3408b7..12a4a4b2874212a192ed05498a0238e3615cd548 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -1,5 +1,6 @@
|
|
package net.pl3x.purpur;
|
|
|
|
+import com.destroystokyo.paper.PaperConfig;
|
|
import net.minecraft.server.Block;
|
|
import net.minecraft.server.Blocks;
|
|
import net.minecraft.server.EnumDifficulty;
|
|
@@ -84,6 +85,17 @@ public class PurpurWorldConfig {
|
|
return PurpurConfig.config.getString("world-settings." + worldName + "." + path, PurpurConfig.config.getString("world-settings.default." + path));
|
|
}
|
|
|
|
+ private void migrateDisableProjectileSaving() {
|
|
+ if (PurpurConfig.version < 6) {
|
|
+ final boolean saveProjectilesToDisk = PurpurConfig.config.getBoolean("world-settings." + worldName + ".gameplay-mechanics.save-projectiles-to-disk", true);
|
|
+ PurpurConfig.config.set("world-settings." + worldName + ".gameplay-mechanics.save-projectiles-to-disk", null);
|
|
+ if (!saveProjectilesToDisk) {
|
|
+ PaperConfig.config.set("world-settings." + worldName + ".projectile-load-save-per-chunk-limit", 0);
|
|
+ PaperConfig.saveConfig();
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+
|
|
public boolean armorstandSetNameVisible = false;
|
|
public boolean armorstandFixNametags = false;
|
|
public float armorstandStepHeight = 0.0F;
|