mirror of
https://github.com/BX-Team/DivineMC.git
synced 2026-01-04 15:31:43 +00:00
add configuration and config optimize
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
||||
Date: Mon, 27 Mar 2023 17:50:05 +0300
|
||||
Subject: [PATCH] Divine Config
|
||||
Subject: [PATCH] Divine Configuration
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
250
patches/server/0003-Divine-Configuration.patch
Normal file
250
patches/server/0003-Divine-Configuration.patch
Normal file
@@ -0,0 +1,250 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
||||
Date: Mon, 27 Mar 2023 13:16:41 +0300
|
||||
Subject: [PATCH] Divine Configuration
|
||||
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
index 2cc44fbf8e5bd436b6d4e19f6c06b351e750cb31..de5086590c457546c6798bb064fe9af0cc6696b1 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
@@ -242,7 +242,8 @@ public class TimingsExport extends Thread {
|
||||
pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)),
|
||||
pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)),
|
||||
pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null)), // Pufferfish
|
||||
- pair("pufferfish", mapAsJSON(gg.pufferfish.pufferfish.PufferfishConfig.getConfigCopy(), null)) // Pufferfish
|
||||
+ pair("pufferfish", mapAsJSON(gg.pufferfish.pufferfish.PufferfishConfig.getConfigCopy(), null)), // Pufferfish // DivineMC
|
||||
+ pair("divinemc", mapAsJSON(gq.bxteam.divinemc.config.DivineConfig.getConfigCopy(), null)) // DivineMC
|
||||
));
|
||||
|
||||
new TimingsExport(listeners, parent, history).start();
|
||||
diff --git a/src/main/java/gq/bxteam/divinemc/config/DivineCommand.java b/src/main/java/gq/bxteam/divinemc/config/DivineCommand.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..cbd2e01fb7d88c056b39a791cf0e4b4725ec5bb0
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/gq/bxteam/divinemc/config/DivineCommand.java
|
||||
@@ -0,0 +1,68 @@
|
||||
+package gq.bxteam.divinemc.config;
|
||||
+
|
||||
+import java.io.IOException;
|
||||
+import java.util.Collections;
|
||||
+import java.util.List;
|
||||
+import java.util.stream.Collectors;
|
||||
+import java.util.stream.Stream;
|
||||
+
|
||||
+import net.kyori.adventure.text.Component;
|
||||
+import net.kyori.adventure.text.format.NamedTextColor;
|
||||
+import net.md_5.bungee.api.ChatColor;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.command.Command;
|
||||
+import org.bukkit.command.CommandSender;
|
||||
+
|
||||
+public class DivineCommand extends Command {
|
||||
+ public DivineCommand() {
|
||||
+ super("divinemc");
|
||||
+ this.description = "DivineMC related commands";
|
||||
+ this.usageMessage = "/divinemc [reload | version]";
|
||||
+ this.setPermission("bukkit.command.divinemc");
|
||||
+ }
|
||||
+
|
||||
+ public static void init() {
|
||||
+ MinecraftServer.getServer().server.getCommandMap().register("divinemc", "DivineMC", new DivineCommand());
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public List<String> tabComplete(CommandSender sender, String alias, String[] args, Location location) throws IllegalArgumentException {
|
||||
+ if (args.length == 1) {
|
||||
+ return Stream.of("reload", "version")
|
||||
+ .filter(arg->arg.startsWith(args[0].toLowerCase()))
|
||||
+ .collect(Collectors.toList());
|
||||
+ }
|
||||
+ return Collections.emptyList();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean execute(CommandSender sender, String commandLabel, String[] args) {
|
||||
+ if (!testPermission(sender)) return true;
|
||||
+ String prefix = ChatColor.of("#12fff6") + "" + ChatColor.BOLD + "DivineMC » " + ChatColor.of("#e8f9f9");
|
||||
+
|
||||
+ if (args.length != 1) {
|
||||
+ sender.sendMessage(prefix + "Usage: " + usageMessage);
|
||||
+ args = new String[]{"version"};
|
||||
+ }
|
||||
+
|
||||
+ if (args[0].equalsIgnoreCase("reload")) {
|
||||
+ MinecraftServer console = MinecraftServer.getServer();
|
||||
+ try {
|
||||
+ DivineConfig.load();
|
||||
+ } catch (IOException e) {
|
||||
+ sender.sendMessage(Component.text("Failed to reload.", NamedTextColor.RED));
|
||||
+ e.printStackTrace();
|
||||
+ return true;
|
||||
+ }
|
||||
+ console.server.reloadCount++;
|
||||
+
|
||||
+ Command.broadcastCommandMessage(sender, prefix + "DivineMC configuration has been reloaded.");
|
||||
+ } else if (args[0].equalsIgnoreCase("version")) {
|
||||
+ Command.broadcastCommandMessage(sender, prefix + "This server is running " + Bukkit.getName() + " version " + Bukkit.getVersion() + " (Implementing API version " + Bukkit.getBukkitVersion() + ")");
|
||||
+ }
|
||||
+
|
||||
+ return true;
|
||||
+ }
|
||||
+}
|
||||
\ No newline at end of file
|
||||
diff --git a/src/main/java/gq/bxteam/divinemc/config/DivineConfig.java b/src/main/java/gq/bxteam/divinemc/config/DivineConfig.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..87346c66366a579f09199fd89f88170f4120c6e0
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/gq/bxteam/divinemc/config/DivineConfig.java
|
||||
@@ -0,0 +1,135 @@
|
||||
+package gq.bxteam.divinemc.config;
|
||||
+
|
||||
+import java.io.File;
|
||||
+import java.io.IOException;
|
||||
+import java.lang.reflect.Method;
|
||||
+import java.lang.reflect.Modifier;
|
||||
+import java.util.List;
|
||||
+
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+
|
||||
+import org.apache.logging.log4j.Level;
|
||||
+import org.bukkit.configuration.ConfigurationSection;
|
||||
+import org.bukkit.configuration.MemoryConfiguration;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+import org.simpleyaml.configuration.comments.CommentType;
|
||||
+import org.simpleyaml.configuration.file.YamlFile;
|
||||
+import org.simpleyaml.exceptions.InvalidConfigurationException;
|
||||
+
|
||||
+public class DivineConfig {
|
||||
+
|
||||
+ private static final YamlFile config = new YamlFile();
|
||||
+ private static int updates = 0;
|
||||
+
|
||||
+ private static ConfigurationSection convertToBukkit(org.simpleyaml.configuration.ConfigurationSection section) {
|
||||
+ ConfigurationSection newSection = new MemoryConfiguration();
|
||||
+ for (String key : section.getKeys(false)) {
|
||||
+ if (section.isConfigurationSection(key)) {
|
||||
+ newSection.set(key, convertToBukkit(section.getConfigurationSection(key)));
|
||||
+ } else {
|
||||
+ newSection.set(key, section.get(key));
|
||||
+ }
|
||||
+ }
|
||||
+ return newSection;
|
||||
+ }
|
||||
+
|
||||
+ public static ConfigurationSection getConfigCopy() {
|
||||
+ return convertToBukkit(config);
|
||||
+ }
|
||||
+
|
||||
+ public static int getUpdates() {
|
||||
+ return updates;
|
||||
+ }
|
||||
+
|
||||
+ public static void load() throws IOException {
|
||||
+ File configFile = new File("divinemc.yml");
|
||||
+
|
||||
+ if (configFile.exists()) {
|
||||
+ try {
|
||||
+ config.load(configFile);
|
||||
+ } catch (InvalidConfigurationException e) {
|
||||
+ throw new IOException(e);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ getString("info.version", "2.0");
|
||||
+ setComment("info",
|
||||
+ "DivineMC Configuration",
|
||||
+ "Join our Discord at https://discord.gg/p7cxhw7E2M",
|
||||
+ "Download new builds at https://github.com/DivineMC/DivineMC/releases/latest");
|
||||
+
|
||||
+ for (Method method : DivineConfig.class.getDeclaredMethods()) {
|
||||
+ if (Modifier.isStatic(method.getModifiers()) && Modifier.isPrivate(method.getModifiers()) && method.getParameterCount() == 0 &&
|
||||
+ method.getReturnType() == Void.TYPE && !method.getName().startsWith("lambda")) {
|
||||
+ method.setAccessible(true);
|
||||
+ try {
|
||||
+ method.invoke(null);
|
||||
+ } catch (Throwable t) {
|
||||
+ MinecraftServer.LOGGER.warn("Failed to load configuration option from " + method.getName(), t);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ updates++;
|
||||
+
|
||||
+ config.save(configFile);
|
||||
+ }
|
||||
+
|
||||
+ private static void setComment(String key, String... comment) {
|
||||
+ if (config.contains(key)) {
|
||||
+ config.setComment(key, String.join("\n", comment), CommentType.BLOCK);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private static void ensureDefault(String key, Object defaultValue, String... comment) {
|
||||
+ if (!config.contains(key)) {
|
||||
+ config.set(key, defaultValue);
|
||||
+ config.setComment(key, String.join("\n", comment), CommentType.BLOCK);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private static boolean getBoolean(String key, boolean defaultValue, String... comment) {
|
||||
+ return getBoolean(key, null, defaultValue, comment);
|
||||
+ }
|
||||
+
|
||||
+ private static boolean getBoolean(String key, @Nullable String oldKey, boolean defaultValue, String... comment) {
|
||||
+ ensureDefault(key, defaultValue, comment);
|
||||
+ return config.getBoolean(key, defaultValue);
|
||||
+ }
|
||||
+
|
||||
+ private static int getInt(String key, int defaultValue, String... comment) {
|
||||
+ return getInt(key, null, defaultValue, comment);
|
||||
+ }
|
||||
+
|
||||
+ private static int getInt(String key, @Nullable String oldKey, int defaultValue, String... comment) {
|
||||
+ ensureDefault(key, defaultValue, comment);
|
||||
+ return config.getInt(key, defaultValue);
|
||||
+ }
|
||||
+
|
||||
+ private static double getDouble(String key, double defaultValue, String... comment) {
|
||||
+ return getDouble(key, null, defaultValue, comment);
|
||||
+ }
|
||||
+
|
||||
+ private static double getDouble(String key, @Nullable String oldKey, double defaultValue, String... comment) {
|
||||
+ ensureDefault(key, defaultValue, comment);
|
||||
+ return config.getDouble(key, defaultValue);
|
||||
+ }
|
||||
+
|
||||
+ private static String getString(String key, String defaultValue, String... comment) {
|
||||
+ return getOldString(key, null, defaultValue, comment);
|
||||
+ }
|
||||
+
|
||||
+ private static String getOldString(String key, @Nullable String oldKey, String defaultValue, String... comment) {
|
||||
+ ensureDefault(key, defaultValue, comment);
|
||||
+ return config.getString(key, defaultValue);
|
||||
+ }
|
||||
+
|
||||
+ private static List<String> getStringList(String key, List<String> defaultValue, String... comment) {
|
||||
+ return getStringList(key, null, defaultValue, comment);
|
||||
+ }
|
||||
+
|
||||
+ private static List<String> getStringList(String key, @Nullable String oldKey, List<String> defaultValue, String... comment) {
|
||||
+ ensureDefault(key, defaultValue, comment);
|
||||
+ return config.getStringList(key);
|
||||
+ }
|
||||
+}
|
||||
\ No newline at end of file
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 582467e3419c23446b20d3076fbfce22115250a8..9623797f9c195f8e2117610b763a360f28e783ac 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -233,6 +233,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
gg.pufferfish.pufferfish.PufferfishConfig.pufferfishFile = (java.io.File) options.valueOf("pufferfish-settings"); // Purpur
|
||||
gg.pufferfish.pufferfish.PufferfishConfig.load(); // Pufferfish
|
||||
gg.pufferfish.pufferfish.PufferfishCommand.init(); // Pufferfish
|
||||
+ gq.bxteam.divinemc.config.DivineConfig.load(); // DivineMC
|
||||
+ gq.bxteam.divinemc.config.DivineCommand.init(); // DivineMC
|
||||
|
||||
this.setPvpAllowed(dedicatedserverproperties.pvp);
|
||||
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
|
||||
383
patches/server/0004-Optimize-default-values-for-configs.patch
Normal file
383
patches/server/0004-Optimize-default-values-for-configs.patch
Normal file
@@ -0,0 +1,383 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
||||
Date: Mon, 27 Mar 2023 13:16:41 +0300
|
||||
Subject: [PATCH] Optimize default values for configs
|
||||
|
||||
|
||||
diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
index 62b2a3a44929b80b813bc24a33cd1f5049fecbb2..27370498849a10977f86e478f10b40a535de39a4 100644
|
||||
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
@@ -211,7 +211,7 @@ public class PufferfishConfig {
|
||||
public static int maxProjectileLoadsPerTick;
|
||||
public static int maxProjectileLoadsPerProjectile;
|
||||
private static void projectileLoading() {
|
||||
- maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick.");
|
||||
+ maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", 8, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick.");
|
||||
maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed.");
|
||||
|
||||
setComment("projectile", "Optimizes projectile settings");
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
index 6bf14183a3fcd2b3d166752ce33240d2ff1ffa7c..26ff05055d8e9df6a9d88e5a8160f9060dcded38 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
@@ -55,7 +55,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public boolean enabled = true;
|
||||
public boolean reallyEnabled = false;
|
||||
public boolean verbose = true;
|
||||
- public String url = "https://timings.aikar.co/";
|
||||
+ public String url = "https://timin.gs/"; // DivineMC - optimize default values for configs
|
||||
public boolean serverNamePrivacy = false;
|
||||
public List<String> hiddenConfigEntries = List.of(
|
||||
"database",
|
||||
@@ -291,9 +291,9 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public boolean fixEntityPositionDesync = true;
|
||||
public boolean loadPermissionsYmlBeforePlugins = true;
|
||||
@Constraints.Min(4)
|
||||
- public int regionFileCacheSize = 256;
|
||||
+ public int regionFileCacheSize = 512; // DivineMC - optimize default values for configs
|
||||
@Comment("See https://luckformula.emc.gs")
|
||||
- public boolean useAlternativeLuckFormula = false;
|
||||
+ public boolean useAlternativeLuckFormula = true; // DivineMC - optimize default values for configs
|
||||
public boolean lagCompensateBlockBreaking = true;
|
||||
public boolean useDimensionTypeForCustomSpawners = false;
|
||||
public boolean strictAdvancementDimensionCheck = false;
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||
index 51cf0014c4229fc8671804d885b6381996810130..6becc866b124945bbbc92e2681471067c355cd3d 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||
@@ -115,9 +115,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
|
||||
public ArmorStands armorStands;
|
||||
|
||||
- public class ArmorStands extends ConfigurationPart {
|
||||
- public boolean doCollisionEntityLookups = true;
|
||||
- public boolean tick = true;
|
||||
+ public class ArmorStands extends ConfigurationPart { // DivineMC - optimize default values for configs
|
||||
+ public boolean doCollisionEntityLookups = false;
|
||||
+ public boolean tick = false;
|
||||
}
|
||||
|
||||
public Spawning spawning;
|
||||
@@ -201,8 +201,8 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public Behavior behavior;
|
||||
|
||||
public class Behavior extends ConfigurationPart {
|
||||
- public boolean disableChestCatDetection = false;
|
||||
- public boolean spawnerNerfedMobsShouldJump = false;
|
||||
+ public boolean disableChestCatDetection = true; // DivineMC - optimize default values for configs
|
||||
+ public boolean spawnerNerfedMobsShouldJump = true; // DivineMC - optimize default values for configs
|
||||
public int experienceMergeMaxValue = -1;
|
||||
public boolean shouldRemoveDragon = false;
|
||||
public boolean zombiesTargetTurtleEggs = true;
|
||||
@@ -249,7 +249,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public int playerInsomniaStartTicks = 72000;
|
||||
public int phantomsSpawnAttemptMinSeconds = 60;
|
||||
public int phantomsSpawnAttemptMaxSeconds = 119;
|
||||
- public boolean parrotsAreUnaffectedByPlayerMovement = false;
|
||||
+ public boolean parrotsAreUnaffectedByPlayerMovement = true; // DivineMC - optimize default values for configs
|
||||
public double zombieVillagerInfectionChance = -1.0;
|
||||
public MobsCanAlwaysPickUpLoot mobsCanAlwaysPickUpLoot;
|
||||
|
||||
@@ -259,7 +259,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
}
|
||||
|
||||
public boolean disablePlayerCrits = false;
|
||||
- public boolean nerfPigmenFromNetherPortals = false;
|
||||
+ public boolean nerfPigmenFromNetherPortals = true; // DivineMC - optimize default values for configs
|
||||
public PillagerPatrols pillagerPatrols;
|
||||
|
||||
public class PillagerPatrols extends ConfigurationPart {
|
||||
@@ -317,7 +317,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public class Environment extends ConfigurationPart {
|
||||
public boolean disableThunder = false;
|
||||
public boolean disableIceAndSnow = false;
|
||||
- public boolean optimizeExplosions = false;
|
||||
+ public boolean optimizeExplosions = true; // DivineMC - optimize default values for configs
|
||||
public boolean disableExplosionKnockback = false;
|
||||
public boolean generateFlatBedrock = false;
|
||||
public FrostedIce frostedIce;
|
||||
@@ -363,7 +363,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
|
||||
public class Maps extends ConfigurationPart {
|
||||
public int itemFrameCursorLimit = 128;
|
||||
- public int itemFrameCursorUpdateInterval = 10;
|
||||
+ public int itemFrameCursorUpdateInterval = 20; // DivineMC - optimize default values for configs
|
||||
}
|
||||
|
||||
public Fixes fixes;
|
||||
@@ -389,7 +389,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public class Hopper extends ConfigurationPart {
|
||||
public boolean cooldownWhenFull = true;
|
||||
public boolean disableMoveEvent = false;
|
||||
- public boolean ignoreOccludingBlocks = false;
|
||||
+ public boolean ignoreOccludingBlocks = true; // DivineMC - optimize default values for configs
|
||||
}
|
||||
|
||||
public Collisions collisions;
|
||||
@@ -397,9 +397,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public class Collisions extends ConfigurationPart {
|
||||
public boolean onlyPlayersCollide = false;
|
||||
public boolean allowVehicleCollisions = true;
|
||||
- public boolean fixClimbingBypassingCrammingRule = false;
|
||||
+ public boolean fixClimbingBypassingCrammingRule = true; // DivineMC - optimize default values for configs
|
||||
@RequiresSpigotInitialization(MaxEntityCollisionsInitializer.class)
|
||||
- public int maxEntityCollisions = 8;
|
||||
+ public int maxEntityCollisions = 2; // DivineMC - optimize default values for configs
|
||||
public boolean allowPlayerCrammingDamage = false;
|
||||
}
|
||||
|
||||
@@ -407,18 +407,31 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
|
||||
public class Chunks extends ConfigurationPart {
|
||||
public AutosavePeriod autoSaveInterval = AutosavePeriod.def();
|
||||
- public int maxAutoSaveChunksPerTick = 24;
|
||||
+ public int maxAutoSaveChunksPerTick = 12;
|
||||
public int fixedChunkInhabitedTime = -1;
|
||||
- public boolean preventMovingIntoUnloadedChunks = false;
|
||||
- public Duration delayChunkUnloadsBy = Duration.of("10s");
|
||||
+ public boolean preventMovingIntoUnloadedChunks = true; // DivineMC - optimize default values for configs
|
||||
+ public Duration delayChunkUnloadsBy = Duration.of("5s"); // DivineMC - optimize default values for configs
|
||||
public Reference2IntMap<EntityType<?>> entityPerChunkSaveLimit = Util.make(new Reference2IntOpenHashMap<>(BuiltInRegistries.ENTITY_TYPE.size()), map -> {
|
||||
- map.defaultReturnValue(-1);
|
||||
- map.put(EntityType.EXPERIENCE_ORB, -1);
|
||||
- map.put(EntityType.SNOWBALL, -1);
|
||||
- map.put(EntityType.ENDER_PEARL, -1);
|
||||
- map.put(EntityType.ARROW, -1);
|
||||
- map.put(EntityType.FIREBALL, -1);
|
||||
- map.put(EntityType.SMALL_FIREBALL, -1);
|
||||
+ // DivineMC start - optimize default values for configs
|
||||
+ map.put(EntityType.EXPERIENCE_ORB, 16);
|
||||
+ map.put(EntityType.SNOWBALL, 8);
|
||||
+ map.put(EntityType.ENDER_PEARL, 8);
|
||||
+ map.put(EntityType.ARROW, 16);
|
||||
+ map.put(EntityType.FIREBALL, 8);
|
||||
+ map.put(EntityType.SMALL_FIREBALL, 8);
|
||||
+ map.put(EntityType.DRAGON_FIREBALL, 3);
|
||||
+ map.put(EntityType.EGG, 8);
|
||||
+ map.put(EntityType.EYE_OF_ENDER, 8);
|
||||
+ map.put(EntityType.FIREWORK_ROCKET, 8);
|
||||
+ map.put(EntityType.POTION, 8);
|
||||
+ map.put(EntityType.LLAMA_SPIT, 3);
|
||||
+ map.put(EntityType.SHULKER_BULLET, 8);
|
||||
+ map.put(EntityType.SPECTRAL_ARROW, 16);
|
||||
+ map.put(EntityType.EXPERIENCE_BOTTLE, 3);
|
||||
+ map.put(EntityType.TRIDENT, 16);
|
||||
+ map.put(EntityType.WITHER_SKULL, 4);
|
||||
+ map.put(EntityType.AREA_EFFECT_CLOUD, 8);
|
||||
+ // DivineMC end
|
||||
});
|
||||
}
|
||||
|
||||
@@ -432,11 +445,22 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public TickRates tickRates;
|
||||
|
||||
public class TickRates extends ConfigurationPart {
|
||||
- public int grassSpread = 1;
|
||||
- public int containerUpdate = 1;
|
||||
- public int mobSpawner = 1;
|
||||
- public Table<EntityType<?>, String, Integer> sensor = Util.make(HashBasedTable.create(), table -> table.put(EntityType.VILLAGER, "secondarypoisensor", 40));
|
||||
- public Table<EntityType<?>, String, Integer> behavior = Util.make(HashBasedTable.create(), table -> table.put(EntityType.VILLAGER, "validatenearbypoi", -1));
|
||||
+ // DivineMC start - optimize default values for configs
|
||||
+ public int grassSpread = 4;
|
||||
+ public int containerUpdate = 3;
|
||||
+ public int mobSpawner = 2;
|
||||
+ public Table<EntityType<?>, String, Integer> sensor = Util.make(HashBasedTable.create(), table -> {
|
||||
+ table.put(EntityType.VILLAGER, "secondarypoisensor", 80);
|
||||
+ table.put(EntityType.VILLAGER, "nearestbedsensor", 80);
|
||||
+ table.put(EntityType.VILLAGER, "villagerbabiessensor", 40);
|
||||
+ table.put(EntityType.VILLAGER, "playersensor", 40);
|
||||
+ table.put(EntityType.VILLAGER, "nearestlivingentitysensor", 40);
|
||||
+ });
|
||||
+ public Table<EntityType<?>, String, Integer> behavior = Util.make(HashBasedTable.create(), table -> {
|
||||
+ table.put(EntityType.VILLAGER, "validatenearbypoi", 60);
|
||||
+ table.put(EntityType.VILLAGER, "acquirepoi", 120);
|
||||
+ });
|
||||
+ // DivineMC end
|
||||
}
|
||||
|
||||
@Setting(FeatureSeedsGeneration.FEATURE_SEEDS_KEY)
|
||||
@@ -444,7 +468,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
|
||||
public class FeatureSeeds extends ConfigurationPart.Post {
|
||||
@Setting(FeatureSeedsGeneration.GENERATE_KEY)
|
||||
- public boolean generateRandomSeedsForAll = false;
|
||||
+ public boolean generateRandomSeedsForAll = true; // DivineMC - optimize default values for configs
|
||||
@Setting(FeatureSeedsGeneration.FEATURES_KEY)
|
||||
public Reference2LongMap<Holder<ConfiguredFeature<?, ?>>> features = new Reference2LongOpenHashMap<>();
|
||||
|
||||
@@ -458,9 +482,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
|
||||
public class Misc extends ConfigurationPart {
|
||||
public int lightQueueSize = 20;
|
||||
- public boolean updatePathfindingOnBlockUpdate = true;
|
||||
+ public boolean updatePathfindingOnBlockUpdate = false; // DivineMC - optimize default values for configs
|
||||
public boolean showSignClickCommandFailureMsgsToPlayer = false;
|
||||
- public RedstoneImplementation redstoneImplementation = RedstoneImplementation.VANILLA;
|
||||
+ public RedstoneImplementation redstoneImplementation = RedstoneImplementation.ALTERNATE_CURRENT; // DivineMC - optimize default values for configs
|
||||
public boolean disableEndCredits = false;
|
||||
public float maxLeashDistance = 10f;
|
||||
public boolean disableSprintInterruptionOnAttack = false;
|
||||
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||
index 5503ad6a93d331771a0e92c0da6adedf2ac81aff..69fb6ac082bb7b77051c5824923a7c1ae222dd73 100644
|
||||
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||
@@ -146,14 +146,14 @@ public class SpigotWorldConfig
|
||||
public double itemMerge;
|
||||
private void itemMerge()
|
||||
{
|
||||
- this.itemMerge = this.getDouble("merge-radius.item", 2.5 );
|
||||
+ this.itemMerge = this.getDouble("merge-radius.item", 3.5 ); // DivineMC - optimize default values for configs
|
||||
this.log( "Item Merge Radius: " + this.itemMerge );
|
||||
}
|
||||
|
||||
public double expMerge;
|
||||
private void expMerge()
|
||||
{
|
||||
- this.expMerge = this.getDouble("merge-radius.exp", 3.0 );
|
||||
+ this.expMerge = this.getDouble("merge-radius.exp", 4.0 ); // DivineMC - optimize default values for configs
|
||||
this.log( "Experience Merge Radius: " + this.expMerge );
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ public class SpigotWorldConfig
|
||||
public byte mobSpawnRange;
|
||||
private void mobSpawnRange()
|
||||
{
|
||||
- this.mobSpawnRange = (byte) getInt( "mob-spawn-range", 8 ); // Paper - Vanilla
|
||||
+ this.mobSpawnRange = (byte) getInt( "mob-spawn-range", 2 ); // Paper - Vanilla // DivineMC - optimize default values for configs
|
||||
this.log( "Mob Spawn Range: " + this.mobSpawnRange );
|
||||
}
|
||||
|
||||
@@ -203,14 +203,14 @@ public class SpigotWorldConfig
|
||||
this.log( "Item Despawn Rate: " + this.itemDespawnRate );
|
||||
}
|
||||
|
||||
- public int animalActivationRange = 32;
|
||||
- public int monsterActivationRange = 32;
|
||||
+ public int animalActivationRange = 16; // DivineMC - optimize default values for configs
|
||||
+ public int monsterActivationRange = 24; // DivineMC - optimize default values for configs
|
||||
public int raiderActivationRange = 48;
|
||||
- public int miscActivationRange = 16;
|
||||
+ public int miscActivationRange = 8; // DivineMC - optimize default values for configs
|
||||
// Paper start
|
||||
public int flyingMonsterActivationRange = 32;
|
||||
- public int waterActivationRange = 16;
|
||||
- public int villagerActivationRange = 32;
|
||||
+ public int waterActivationRange = 8; // DivineMC - optimize default values for configs
|
||||
+ public int villagerActivationRange = 16; // DivineMC - optimize default values for configs
|
||||
public int wakeUpInactiveAnimals = 4;
|
||||
public int wakeUpInactiveAnimalsEvery = 60*20;
|
||||
public int wakeUpInactiveAnimalsFor = 5*20;
|
||||
@@ -227,7 +227,7 @@ public class SpigotWorldConfig
|
||||
public int villagersWorkImmunityFor = 20;
|
||||
public boolean villagersActiveForPanic = true;
|
||||
// Paper end
|
||||
- public boolean tickInactiveVillagers = true;
|
||||
+ public boolean tickInactiveVillagers = false; // DivineMC - optimize default values for configs
|
||||
public boolean ignoreSpectatorActivation = false;
|
||||
private void activationRange()
|
||||
{
|
||||
@@ -293,7 +293,7 @@ public class SpigotWorldConfig
|
||||
{
|
||||
this.set( "ticks-per.hopper-check", 1 );
|
||||
}
|
||||
- this.hopperCheck = this.getInt( "ticks-per.hopper-check", 1 );
|
||||
+ this.hopperCheck = this.getInt( "ticks-per.hopper-check", 8 ); // DivineMC - optimize default values for configs
|
||||
this.hopperAmount = this.getInt( "hopper-amount", 1 );
|
||||
this.hopperCanLoadChunks = this.getBoolean( "hopper-can-load-chunks", false );
|
||||
this.log( "Hopper Transfer: " + this.hopperTransfer + " Hopper Check: " + this.hopperCheck + " Hopper Amount: " + this.hopperAmount + " Hopper Can Load Chunks: " + this.hopperCanLoadChunks );
|
||||
@@ -303,7 +303,7 @@ public class SpigotWorldConfig
|
||||
public int tridentDespawnRate;
|
||||
private void arrowDespawnRate()
|
||||
{
|
||||
- this.arrowDespawnRate = this.getInt( "arrow-despawn-rate", 1200 );
|
||||
+ this.arrowDespawnRate = this.getInt( "arrow-despawn-rate", 300 ); // DivineMC - optimize default values for configs
|
||||
this.tridentDespawnRate = this.getInt( "trident-despawn-rate", this.arrowDespawnRate );
|
||||
this.log( "Arrow Despawn Rate: " + this.arrowDespawnRate + " Trident Respawn Rate:" + this.tridentDespawnRate );
|
||||
}
|
||||
@@ -318,14 +318,14 @@ public class SpigotWorldConfig
|
||||
public boolean nerfSpawnerMobs;
|
||||
private void nerfSpawnerMobs()
|
||||
{
|
||||
- this.nerfSpawnerMobs = this.getBoolean( "nerf-spawner-mobs", false );
|
||||
+ this.nerfSpawnerMobs = this.getBoolean( "nerf-spawner-mobs", true ); // DivineMC - optimize default values for configs
|
||||
this.log( "Nerfing mobs spawned from spawners: " + this.nerfSpawnerMobs );
|
||||
}
|
||||
|
||||
public boolean enableZombiePigmenPortalSpawns;
|
||||
private void enableZombiePigmenPortalSpawns()
|
||||
{
|
||||
- this.enableZombiePigmenPortalSpawns = this.getBoolean( "enable-zombie-pigmen-portal-spawns", true );
|
||||
+ this.enableZombiePigmenPortalSpawns = this.getBoolean( "enable-zombie-pigmen-portal-spawns", false ); // DivineMC - optimize default values for configs
|
||||
this.log( "Allow Zombie Pigmen to spawn from portal blocks: " + this.enableZombiePigmenPortalSpawns );
|
||||
}
|
||||
|
||||
@@ -439,7 +439,7 @@ public class SpigotWorldConfig
|
||||
public int hangingTickFrequency;
|
||||
private void hangingTickFrequency()
|
||||
{
|
||||
- this.hangingTickFrequency = this.getInt( "hanging-tick-frequency", 100 );
|
||||
+ this.hangingTickFrequency = this.getInt( "hanging-tick-frequency", 200 ); // DivineMC - optimize default values for configs
|
||||
}
|
||||
|
||||
public int tileMaxTickTime;
|
||||
diff --git a/src/main/resources/configurations/bukkit.yml b/src/main/resources/configurations/bukkit.yml
|
||||
index eef7c125b2689f29cae5464659eacdf33f5695b2..8dbcf5f20dd99dba5d21ec6cd293a7534652c328 100644
|
||||
--- a/src/main/resources/configurations/bukkit.yml
|
||||
+++ b/src/main/resources/configurations/bukkit.yml
|
||||
@@ -18,28 +18,28 @@ settings:
|
||||
update-folder: update
|
||||
plugin-profiling: false
|
||||
connection-throttle: 4000
|
||||
- query-plugins: true
|
||||
+ query-plugins: false
|
||||
deprecated-verbose: default
|
||||
shutdown-message: Server closed
|
||||
minimum-api: none
|
||||
use-map-color-cache: true
|
||||
spawn-limits:
|
||||
- monsters: 70
|
||||
- animals: 10
|
||||
- water-animals: 5
|
||||
- water-ambient: 20
|
||||
- water-underground-creature: 5
|
||||
- axolotls: 5
|
||||
- ambient: 15
|
||||
+ monsters: 20
|
||||
+ animals: 5
|
||||
+ water-animals: 2
|
||||
+ water-ambient: 2
|
||||
+ water-underground-creature: 3
|
||||
+ axolotls: 3
|
||||
+ ambient: 1
|
||||
chunk-gc:
|
||||
- period-in-ticks: 600
|
||||
+ period-in-ticks: 400
|
||||
ticks-per:
|
||||
animal-spawns: 400
|
||||
- monster-spawns: 1
|
||||
- water-spawns: 1
|
||||
- water-ambient-spawns: 1
|
||||
- water-underground-creature-spawns: 1
|
||||
- axolotl-spawns: 1
|
||||
- ambient-spawns: 1
|
||||
+ monster-spawns: 10
|
||||
+ water-spawns: 400
|
||||
+ water-ambient-spawns: 400
|
||||
+ water-underground-creature-spawns: 400
|
||||
+ axolotl-spawns: 400
|
||||
+ ambient-spawns: 400
|
||||
autosave: 6000
|
||||
-aliases: now-in-commands.yml
|
||||
+aliases: now-in-commands.yml
|
||||
\ No newline at end of file
|
||||
diff --git a/src/main/resources/configurations/commands.yml b/src/main/resources/configurations/commands.yml
|
||||
index 18f54571200e2eca09a39b88f170fe7b99d8618f..1b57d51d92c5c69286800d10baeaa936fa208cae 100644
|
||||
--- a/src/main/resources/configurations/commands.yml
|
||||
+++ b/src/main/resources/configurations/commands.yml
|
||||
@@ -12,5 +12,3 @@
|
||||
command-block-overrides: []
|
||||
ignore-vanilla-permissions: false
|
||||
aliases:
|
||||
- icanhasbukkit:
|
||||
- - "version $1-"
|
||||
Reference in New Issue
Block a user