From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: IPECTER Date: Tue, 7 Mar 2023 12:28:34 +0900 Subject: [PATCH] Optimize Default Configurations Original: YouHaveTrouble/minecraft-optimization, AkiraDevelopment/SimplyMC Copyright (C) 2023 YouHaveTrouble, AkiraDevelopment diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java index b4e5fbace85c67e7bd347e6a90514bbc2c132d5e..edc8eba38af743167a8b78d34cb426d6929f9605 100644 --- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java +++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java @@ -211,8 +211,8 @@ 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."); - maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed."); + maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 10 : 8, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick."); // Plazma + 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"); } @@ -225,16 +225,16 @@ public class PufferfishConfig { public static int activationDistanceMod; private static void dynamicActivationOfBrains() throws IOException { - dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", false); // Purpur - startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12, + dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", !Boolean.getBoolean("Plazma.disableConfigOptimization")); // Purpur // Plazma + startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12, "This value determines how far away an entity has to be", "from the player to start being effected by DEAR."); startDistanceSquared = startDistance * startDistance; maximumActivationPrio = getInt("dab.max-tick-freq", "activation-range.max-tick-freq", 20, "This value defines how often in ticks, the furthest entity", "will get their pathfinders and behaviors ticked. 20 = 1s"); - activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", 8, - "This value defines how much distance modifies an entity's", + activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 8 : 7, // Plazma + "This value defines how much distance modifies an entity's", "tick frequency. freq = (distanceToPlayer^2) / (2^value)", "If you want further away entities to tick less often, use 7.", "If you want further away entities to tick more often, try 9."); diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java index 8d442c5a498ecf288a0cc0c54889c6e2fda849ce..205ce3456a3f6d28cc2c7cbc131ec0f63a461527 100644 --- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java +++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java @@ -103,7 +103,7 @@ public class GlobalConfiguration extends ConfigurationPart { public class Watchdog extends ConfigurationPart { public int earlyWarningEvery = 5000; - public int earlyWarningDelay = 10000; + public int earlyWarningDelay = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 10000 : 180000; // Plazma - Optimize Default Configurations } public SpamLimiter spamLimiter; diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java index a33de97340f14219291c4175e9194914cdf441db..f63b4ab2057176d4f1549200eef16e71c6018dc2 100644 --- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java +++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java @@ -84,15 +84,15 @@ public class WorldConfiguration extends ConfigurationPart { public class AntiXray extends ConfigurationPart { public boolean enabled = false; - public EngineMode engineMode = EngineMode.HIDE; + public EngineMode engineMode = Boolean.getBoolean("Plazma.disableConfigOptimization") ? EngineMode.HIDE : EngineMode.OBFUSCATE_LAYER; // Plazma - Optimize Default Configurations public int maxBlockHeight = 64; public int updateRadius = 2; public boolean lavaObscures = false; public boolean usePermission = false; - public List hiddenBlocks = List.of("copper_ore", "deepslate_copper_ore", "gold_ore", "deepslate_gold_ore", "iron_ore", "deepslate_iron_ore", - "coal_ore", "deepslate_coal_ore", "lapis_ore", "deepslate_lapis_ore", "mossy_cobblestone", "obsidian", "chest", "diamond_ore", "deepslate_diamond_ore", - "redstone_ore", "deepslate_redstone_ore", "clay", "emerald_ore", "deepslate_emerald_ore", "ender_chest"); // TODO update type to List - public List replacementBlocks = List.of("stone", "oak_planks", "deepslate"); // TODO update type to List + // Plazma start - Optimize Default Configurations + public List hiddenBlocks = List.of("air", "copper_ore", "deepslate_copper_ore", "raw_copper_block", "diamond_ore", "deepslate_diamond_ore", "gold_ore", "deepslate_gold_ore", "iron_ore", "deepslate_iron_ore", "raw_iron_block", "lapis_ore", "deepslate_lapis_ore", "redstone_ore", "deepslate_redstone_ore"); // TODO update type to List + public List replacementBlocks = List.of("chest", "amethyst_block", "andesite", "budding_amethyst", "calcite", "coal_ore", "deepslate_coal_ore", "deepslate", "diorite", "dirt", "emerald_ore", "deepslate_emerald_ore", "granite", "gravel", "oak_planks", "smooth_basalt", "stone", "tuff"); // TODO update type to List + // Plazma end } } @@ -139,7 +139,7 @@ public class WorldConfiguration extends ConfigurationPart { @MergeMap public Reference2IntMap spawnLimits = Util.make(new Reference2IntOpenHashMap<>(NaturalSpawner.SPAWNING_CATEGORIES.length), map -> Arrays.stream(NaturalSpawner.SPAWNING_CATEGORIES).forEach(mobCategory -> map.put(mobCategory, -1))); @MergeMap - public Map despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), category.getDespawnDistance()))); + public Map despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), Boolean.getBoolean("Plazma.disableConfigOptimization") ? category.getDespawnDistance() : (net.minecraft.server.MinecraftServer.getServer().server.getSimulationDistance() * 16) + 8))); // Plazma - Optimize Default Configurations @ConfigSerializable public record DespawnRange(@Required int soft, @Required int hard) { @@ -323,7 +323,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 = !Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations public boolean disableExplosionKnockback = false; public boolean generateFlatBedrock = false; public FrostedIce frostedIce; @@ -403,9 +403,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 = !Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations @RequiresSpigotInitialization(MaxEntityCollisionsInitializer.class) - public int maxEntityCollisions = 8; + public int maxEntityCollisions = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 8 : 2; // Plazma - Optimize Default Configurations public boolean allowPlayerCrammingDamage = false; } @@ -413,18 +413,40 @@ public class WorldConfiguration extends ConfigurationPart { public class Chunks extends ConfigurationPart { public AutosavePeriod autoSaveInterval = AutosavePeriod.def(); - public int maxAutoSaveChunksPerTick = 24; + public int maxAutoSaveChunksPerTick = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 24 : 8; // Plazma - Optimize Default Configurations public int fixedChunkInhabitedTime = -1; - public boolean preventMovingIntoUnloadedChunks = false; + public boolean preventMovingIntoUnloadedChunks = !Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations public Duration delayChunkUnloadsBy = Duration.of("10s"); public Reference2IntMap> 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); + // Plazma start - Optimize Default Configurations + if (!Boolean.getBoolean("Plazma.disableConfigOptimization")) { + map.put(EntityType.AREA_EFFECT_CLOUD, 8); + map.put(EntityType.ARROW, 16); + map.put(EntityType.DRAGON_FIREBALL, 3); + map.put(EntityType.EGG, 8); + map.put(EntityType.ENDER_PEARL, 8); + map.put(EntityType.EXPERIENCE_BOTTLE, 3); + map.put(EntityType.EXPERIENCE_ORB, 16); + map.put(EntityType.EYE_OF_ENDER, 8); + map.put(EntityType.FIREBALL, 8); + map.put(EntityType.FIREWORK_ROCKET, 8); + map.put(EntityType.LLAMA_SPIT, 3); + map.put(EntityType.POTION, 8); + map.put(EntityType.SHULKER_BULLET, 8); + map.put(EntityType.SMALL_FIREBALL, 8); + map.put(EntityType.SNOWBALL, 8); + map.put(EntityType.SPECTRAL_ARROW, 16); + map.put(EntityType.TRIDENT, 16); + map.put(EntityType.WITHER_SKULL, 4); + } else { + 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); + } + // Plazma end }); public boolean flushRegionsOnSave = false; } @@ -439,9 +461,9 @@ public class WorldConfiguration extends ConfigurationPart { public TickRates tickRates; public class TickRates extends ConfigurationPart { - public int grassSpread = 1; + public int grassSpread = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 1 : 4; // Plazma - Optimize Default Configurations public int containerUpdate = 1; - public int mobSpawner = 1; + public int mobSpawner = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 1 : 2; // Plazma - Optimize Default Configurations public Table, String, Integer> sensor = Util.make(HashBasedTable.create(), table -> table.put(EntityType.VILLAGER, "secondarypoisensor", 40)); public Table, String, Integer> behavior = Util.make(HashBasedTable.create(), table -> table.put(EntityType.VILLAGER, "validatenearbypoi", -1)); } @@ -465,9 +487,9 @@ public class WorldConfiguration extends ConfigurationPart { public class Misc extends ConfigurationPart { public int lightQueueSize = 20; - public boolean updatePathfindingOnBlockUpdate = true; + public boolean updatePathfindingOnBlockUpdate = Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations public boolean showSignClickCommandFailureMsgsToPlayer = false; - public RedstoneImplementation redstoneImplementation = RedstoneImplementation.VANILLA; + public RedstoneImplementation redstoneImplementation = Boolean.getBoolean("Plazma.disableConfigOptimization") ? RedstoneImplementation.VANILLA : RedstoneImplementation.ALTERNATE_CURRENT; // Plazma - Optimize Default Configurations public boolean disableEndCredits = false; public float maxLeashDistance = 10f; public boolean disableSprintInterruptionOnAttack = false; diff --git a/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java b/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java index 24763d3d270c29c95e0b3e85111145234f660a62..18bc271a34ffba8c83743fef7eaf4a2c1a2bfdec 100644 --- a/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java +++ b/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java @@ -29,6 +29,7 @@ public class ArrowDespawnRate extends FallbackValue.Int { @Override protected int fallback() { + if (!Boolean.getBoolean("Plazma.disableConfigOptimization")) return 100; // Plazma - Optimize Default Configurations return this.get(FallbackValue.SPIGOT_WORLD_CONFIG).arrowDespawnRate; } diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java index 5ed7acb332b8982a724e5002e12f18fe32dd4dd4..8a10f9b7b837c4d20eaf4a83827e36f14a180ea7 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java @@ -154,7 +154,7 @@ public class Main { File configFile = (File) optionset.valueOf("bukkit-settings"); YamlConfiguration configuration = YamlConfiguration.loadConfiguration(configFile); configuration.options().copyDefaults(true); - configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(Main.class.getClassLoader().getResourceAsStream("configurations/bukkit.yml"), Charsets.UTF_8))); + configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(Main.class.getClassLoader().getResourceAsStream(Boolean.getBoolean("Plazma.disableConfigOptimization") ? "configurations/bukkit.yml" : "configurations/bukkit_optimized.yml"), Charsets.UTF_8))); // Plazma - Optimize Default Configurations configuration.save(configFile); File commandFile = (File) optionset.valueOf("commands-settings"); diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java index 1ea3012995c738c67b31e997c138f824f9e69ba1..8ed00a650b712cbf4bc8796165a539d76d390d0f 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java @@ -120,7 +120,7 @@ public class DedicatedServerProperties extends Settings { return Mth.clamp(integer, 1, 29999984); }, 29999984); - this.syncChunkWrites = this.get("sync-chunk-writes", true) && Boolean.getBoolean("Paper.enable-sync-chunk-writes"); // Paper - hide behind flag + this.syncChunkWrites = Boolean.getBoolean("Paper.enable-sync-chunk-writes"); // Paper - hide behind flag // Plazma - Optimize Default Configurations this.enableJmxMonitoring = this.get("enable-jmx-monitoring", false); this.enableStatus = this.get("enable-status", true); this.hideOnlinePlayers = this.get("hide-online-players", false); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 1367072684078c0e93c275c2159ece799f96428b..84fb7f6cdad5e7a5389e2469bfd6fb961cd1b299 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -354,7 +354,7 @@ public final class CraftServer implements Server { this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile()); this.configuration.options().copyDefaults(true); - this.configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(getClass().getClassLoader().getResourceAsStream("configurations/bukkit.yml"), Charsets.UTF_8))); + this.configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(getClass().getClassLoader().getResourceAsStream(Boolean.getBoolean("Plazma.disableConfigOptimization") ? "configurations/bukkit.yml" : "configurations/bukkit_optimized.yml"), Charsets.UTF_8))); // Plazma - Optimize Default Configurations ConfigurationSection legacyAlias = null; if (!this.configuration.isString("aliases")) { legacyAlias = this.configuration.getConfigurationSection("aliases"); diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java index c93f6d275d0541e0751eefca45d17c4ccd39a62a..38a8f79b0075279389f0b3dc7de4b16d9af05295 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java @@ -49,7 +49,10 @@ public class PurpurConfig { + "join us in our Discord guild.\n" + "\n" + "Website: https://purpurmc.org \n" - + "Docs: https://purpurmc.org/docs \n"; + // Plazma start + + "Docs: https://purpurmc.org/docs \n" + + "Vanilla Food Properties: https://gist.github.com/BillyGalbreath/4fdfba991bd020e814eabf5143e3b225 \n"; + // Plazma end private static File CONFIG_FILE; public static YamlConfiguration config; @@ -239,7 +242,7 @@ public class PurpurConfig { laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold); } - public static boolean useAlternateKeepAlive = false; + public static boolean useAlternateKeepAlive = !Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations private static void useAlternateKeepAlive() { useAlternateKeepAlive = getBoolean("settings.use-alternate-keepalive", useAlternateKeepAlive); } diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java index 397c4afa8da85845f49974832674a6e45ee6edb7..ce702e6b5fff3a54f9f254a61becd12eb5c11dd7 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java @@ -427,7 +427,7 @@ public class PurpurWorldConfig { public boolean playerInvulnerableWhileAcceptingResourcePack = false; public String playerDeathExpDropEquation = "expLevel * 7"; public int playerDeathExpDropMax = 100; - public boolean teleportIfOutsideBorder = false; + public boolean teleportIfOutsideBorder = !Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations public boolean teleportOnNetherCeilingDamage = false; public boolean totemOfUndyingWorksInInventory = false; public boolean playerFixStuckPortal = false; @@ -3040,7 +3040,7 @@ public class PurpurWorldConfig { public boolean zombieJockeyOnlyBaby = true; public double zombieJockeyChance = 0.05D; public boolean zombieJockeyTryExistingChickens = true; - public boolean zombieAggressiveTowardsVillagerWhenLagging = true; + public boolean zombieAggressiveTowardsVillagerWhenLagging = Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations public boolean zombieBypassMobGriefing = false; public boolean zombieTakeDamageFromWater = false; public boolean zombieAlwaysDropExp = false; diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java index bbfafb1400721251dfd2cac4dd8a31be2d682d4b..f61aca65f9d9bc6888285def1c9016f7a7395919 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java @@ -148,14 +148,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", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 2.5 : 3.5 ); // Plazma - Optimize Default Configurations 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", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 3.0 : 4.0 ); // Plazma - Optimize Default Configurations this.log( "Experience Merge Radius: " + this.expMerge ); } @@ -194,7 +194,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", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 8 : 3 ); // Paper - Vanilla // Plazma - Optimize Default Configurations this.log( "Mob Spawn Range: " + this.mobSpawnRange ); } @@ -205,26 +205,26 @@ public class SpigotWorldConfig this.log( "Item Despawn Rate: " + this.itemDespawnRate ); } - public int animalActivationRange = 32; - public int monsterActivationRange = 32; + public int animalActivationRange = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 32 : 16; // Plazma - Optimize Default Configurations + public int monsterActivationRange = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 32 : 24; // Plazma - Optimize Default Configurations public int raiderActivationRange = 48; - public int miscActivationRange = 16; + public int miscActivationRange = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 16 : 8; // Plazma - Optimize Default Configurations // Paper start - public int flyingMonsterActivationRange = 32; - public int waterActivationRange = 16; - public int villagerActivationRange = 32; + public int flyingMonsterActivationRange = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 32 : 48; // Plazma - Optimize Default Configurations + public int waterActivationRange = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 16 : 8; // Plazma - Optimize Default Configurations + public int villagerActivationRange = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 32 : 16; // Plazma - Optimize Default Configurations public int wakeUpInactiveAnimals = 4; public int wakeUpInactiveAnimalsEvery = 60*20; - public int wakeUpInactiveAnimalsFor = 5*20; - public int wakeUpInactiveMonsters = 8; + public int wakeUpInactiveAnimalsFor = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 5*20 : 40; // Plazma - Optimize Default Configurations + public int wakeUpInactiveMonsters = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 8 : 4; // Plazma - Optimize Default Configurations public int wakeUpInactiveMonstersEvery = 20*20; - public int wakeUpInactiveMonstersFor = 5*20; - public int wakeUpInactiveVillagers = 4; + public int wakeUpInactiveMonstersFor = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 5*20 : 60; // Plazma - Optimize Default Configurations + public int wakeUpInactiveVillagers = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 4 : 1; // Plazma - Optimize Default Configurations public int wakeUpInactiveVillagersEvery = 30*20; - public int wakeUpInactiveVillagersFor = 5*20; - public int wakeUpInactiveFlying = 8; + public int wakeUpInactiveVillagersFor = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 5*20 : 20; // Plazma - Optimize Default Configurations + public int wakeUpInactiveFlying = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 8 : 1; // Plazma - Optimize Default Configurations public int wakeUpInactiveFlyingEvery = 10*20; - public int wakeUpInactiveFlyingFor = 5*20; + public int wakeUpInactiveFlyingFor = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 5*20 : 60; // Plazma - Optimize Default Configurations public int villagersWorkImmunityAfter = 5*20; public int villagersWorkImmunityFor = 20; public boolean villagersActiveForPanic = true; @@ -297,7 +297,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", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 1 : 8 ); // Plazma - Optimize Default Configurations 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 ); @@ -307,7 +307,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", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 1200 : 300 ); // Plazma - Optimize Default Configurations this.tridentDespawnRate = this.getInt( "trident-despawn-rate", this.arrowDespawnRate ); this.log( "Arrow Despawn Rate: " + this.arrowDespawnRate + " Trident Respawn Rate:" + this.tridentDespawnRate ); } diff --git a/src/main/resources/configurations/bukkit_optimized.yml b/src/main/resources/configurations/bukkit_optimized.yml new file mode 100644 index 0000000000000000000000000000000000000000..eb33b0a19d6060f78d7ead7a2ad63b1b2581293d --- /dev/null +++ b/src/main/resources/configurations/bukkit_optimized.yml @@ -0,0 +1,45 @@ +# This is the main configuration file for Bukkit. +# As you can see, there's actually not that much to configure without any plugins. +# For a reference for any variable inside this file, check out the Bukkit Wiki at +# https://www.spigotmc.org/go/bukkit-yml +# +# If you need help on this file, feel free to join us on Discord or leave a message +# on the forums asking for advice. +# +# Discord: https://www.spigotmc.org/go/discord +# Forums: https://www.spigotmc.org/ +# Bug tracker: https://www.spigotmc.org/go/bugs + + +settings: + allow-end: true + warn-on-overload: true + permissions-file: permissions.yml + update-folder: update + plugin-profiling: false + connection-throttle: 4000 + query-plugins: true + deprecated-verbose: default + shutdown-message: Server closed + minimum-api: none + use-map-color-cache: true +spawn-limits: + monsters: 20 + animals: 5 + water-animals: 2 + water-ambient: 2 + water-underground-creature: 3 + axolotls: 3 + ambient: 1 +chunk-gc: + period-in-ticks: 400 +ticks-per: + animal-spawns: 400 + 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