From a8ca031947e6676483013d13c8e25314cf73a287 Mon Sep 17 00:00:00 2001 From: lewmilburn <63267144+lewmilburn@users.noreply.github.com> Date: Sat, 25 May 2024 19:25:23 +0100 Subject: [PATCH] Added some more configurable values, nerfed mobs can now not drown. --- .../lewmc/kryptonite/optimiser/Optimiser.java | 22 ++++++++++++++++++- .../kryptonite/optimiser/PaperWorld.java | 4 ++++ src/main/resources/config.yml | 5 ++++- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/lewmc/kryptonite/optimiser/Optimiser.java b/src/main/java/net/lewmc/kryptonite/optimiser/Optimiser.java index a4a4704..1314f4e 100644 --- a/src/main/java/net/lewmc/kryptonite/optimiser/Optimiser.java +++ b/src/main/java/net/lewmc/kryptonite/optimiser/Optimiser.java @@ -90,6 +90,16 @@ private void runCraftBukkit() { private void runSpigot() { if (this.softwareUtil.isSpigot()) { this.log.info("[KOS] 3/6 - Running Spigot optimisations"); + + try { + this.plugin.getConfig().load("plugins/Kryptonite/config.yml"); + } catch (IOException | InvalidConfigurationException e) { + this.message.Error("Unable to open configuration, see console for more information."); + this.message.Error("Kryptonite Optimisation System Aborted."); + this.log.severe(e.getMessage()); + return; + } + Spigot spigot = new Spigot(this.plugin); spigot.viewDistance("default"); @@ -97,7 +107,7 @@ private void runSpigot() { spigot.entityActivationRange(16, 24, 48, 8, 8, 16, 48); spigot.entityTrackingRange(48, 48, 48, 32, 64); spigot.tickInacativeVillagers(false); - spigot.nerfSpawnerMobs(true); + spigot.nerfSpawnerMobs(this.plugin.getConfig().getBoolean("spawner-mobs.nerfed")); spigot.mergeRadius(3.5, 4.0); spigot.hopperTransfer(8); spigot.hopperCheck(8); @@ -111,6 +121,15 @@ private void runSpigot() { private void runPaper(boolean pregeneratedWorld) { if (this.softwareUtil.isPaper()) { this.log.info("[KOS] 4/4 - Running Paper optimisations"); + try { + this.plugin.getConfig().load("plugins/Kryptonite/config.yml"); + } catch (IOException | InvalidConfigurationException e) { + this.message.Error("Unable to open configuration, see console for more information."); + this.message.Error("Kryptonite Optimisation System Aborted."); + this.log.severe(e.getMessage()); + return; + } + PaperWorld pw = new PaperWorld(this.plugin); pw.delayChunkUnloads(10); pw.maxAutosaveChunksPerTick(8); @@ -132,6 +151,7 @@ private void runPaper(boolean pregeneratedWorld) { pw.fixClimbingBypassingCrammingRule(true); pw.armorStandsTick(false); pw.armorStandsDoCollisionEntityLookups(false); + pw.spawnerNerfedMobsShouldJump(this.plugin.getConfig().getBoolean("spawner.nerded-can-jump")); if (this.plugin.server != Kryptonite.Software.PUFFERFISH) { pw.villagerBehaviourTickRates(60, 120); diff --git a/src/main/java/net/lewmc/kryptonite/optimiser/PaperWorld.java b/src/main/java/net/lewmc/kryptonite/optimiser/PaperWorld.java index fda18fe..09321eb 100644 --- a/src/main/java/net/lewmc/kryptonite/optimiser/PaperWorld.java +++ b/src/main/java/net/lewmc/kryptonite/optimiser/PaperWorld.java @@ -247,6 +247,10 @@ public void creativeArrowDespawnRate(int value) { this.plugin.getConfig().set("entities.spawning.creative-arrow-despawn-rate", value); } + public void spawnerNerfedMobsShouldJump(boolean value) { + this.plugin.getConfig().set("spawner-nerfed-mobs-should-jump", value); + } + public void save() { try { this.plugin.getConfig().save(this.file); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 0be0210..cd07f3f 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -16,4 +16,7 @@ using-tcpshield: false entities-can-use-portals: false villagers: lobotomized: false - search-radius: 16 \ No newline at end of file + search-radius: 16 +spawner-mobs: + nerfed: true + nerded-can-jump: false \ No newline at end of file