Skip to content

Commit af94364

Browse files
Fix slime spawners not spawning outside slime chunks (#7741)
1 parent 1cfd363 commit af94364

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Jake Potrebic <jake.m.potrebic@gmail.com>
3+
Date: Fri, 15 Apr 2022 17:09:28 -0700
4+
Subject: [PATCH] Fix slime spawners not spawning outside slime chunks
5+
6+
Fixes MC-50647 by just checking if the spawn type is a SPAWNER
7+
and then bypassing the spawn check logic if on slimes if it is.
8+
9+
diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java
10+
index b6e78e8145ea78d532f22707c7525829c5778076..2e819d32915941bd77034ce599eb787610a6d666 100644
11+
--- a/src/main/java/net/minecraft/world/entity/monster/Slime.java
12+
+++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java
13+
@@ -325,6 +325,11 @@ public class Slime extends Mob implements Enemy {
14+
15+
public static boolean checkSlimeSpawnRules(EntityType<Slime> type, LevelAccessor world, MobSpawnType spawnReason, BlockPos pos, Random random) {
16+
if (world.getDifficulty() != Difficulty.PEACEFUL) {
17+
+ // Paper start - fix slime spawners; Fixes MC-50647
18+
+ if (spawnReason == MobSpawnType.SPAWNER) {
19+
+ return random.nextInt(10) == 0;
20+
+ }
21+
+ // Paper end
22+
// Paper start - Replace rules for Height in Swamp Biome
23+
final double maxHeightSwamp = world.getMinecraftWorld().paperConfig.slimeMaxSpawnHeightInSwamp;
24+
final double minHeightSwamp = world.getMinecraftWorld().paperConfig.slimeMinSpawnHeightInSwamp;

0 commit comments

Comments
 (0)