Paper/Spigot-Server-Patches/0045-All-chunks-are-slime-spawn-chunks-toggle.patch

34 lines
2.1 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2016-03-01 00:09:49 +01:00
From: vemacs <d@nkmem.es>
Date: Thu, 3 Mar 2016 01:19:22 -0600
Subject: [PATCH] All chunks are slime spawn chunks toggle
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 345ac63e281bb3372b2ae879d587d658243581ba..62e793b71b313146b86b466421e7a5f894bef9df 100644
2016-03-01 00:09:49 +01:00
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -186,4 +186,9 @@ public class PaperWorldConfig {
2016-03-01 00:09:49 +01:00
private void disableChestCatDetection() {
disableChestCatDetection = getBoolean("game-mechanics.disable-chest-cat-detection", false);
}
+
+ public boolean allChunksAreSlimeChunks;
+ private void allChunksAreSlimeChunks() {
+ allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false);
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java
index dd7ceb679c1b03c419bb2a2799328aed889b1caf..cb7cf185cc93813de97fbab830856573af8b6e73 100644
2016-03-01 00:09:49 +01:00
--- a/src/main/java/net/minecraft/server/EntitySlime.java
+++ b/src/main/java/net/minecraft/server/EntitySlime.java
2020-06-25 11:27:25 +02:00
@@ -285,7 +285,7 @@ public class EntitySlime extends EntityInsentient implements IMonster {
}
2020-06-25 11:27:25 +02:00
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(blockposition);
- boolean flag = SeededRandom.a(chunkcoordintpair.x, chunkcoordintpair.z, ((GeneratorAccessSeed) generatoraccess).getSeed(), generatoraccess.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot
+ boolean flag = generatoraccess.getMinecraftWorld().paperConfig.allChunksAreSlimeChunks || SeededRandom.a(chunkcoordintpair.x, chunkcoordintpair.z, ((GeneratorAccessSeed) generatoraccess).getSeed(), generatoraccess.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot // Paper
2020-06-25 11:27:25 +02:00
if (random.nextInt(10) == 0 && flag && blockposition.getY() < 40) {
return a(entitytypes, generatoraccess, enummobspawn, blockposition, random);