Skip to content

Commit

Permalink
Added some more configurable values, nerfed mobs can now not drown.
Browse files Browse the repository at this point in the history
  • Loading branch information
lewmilburn committed May 25, 2024
1 parent f2eb451 commit a8ca031
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
22 changes: 21 additions & 1 deletion src/main/java/net/lewmc/kryptonite/optimiser/Optimiser.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,24 @@ 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");
spigot.mobSpawnRange(3);
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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/net/lewmc/kryptonite/optimiser/PaperWorld.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ using-tcpshield: false
entities-can-use-portals: false
villagers:
lobotomized: false
search-radius: 16
search-radius: 16
spawner-mobs:
nerfed: true
nerded-can-jump: false

0 comments on commit a8ca031

Please sign in to comment.