Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 04:20:08 +01:00
Add Chunk.isSlimeChunk to check if a chunk can spawn slimes
Dieser Commit ist enthalten in:
Ursprung
4959e46f53
Commit
319013857d
@ -3,6 +3,7 @@ package org.bukkit.craftbukkit;
|
|||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
import net.minecraft.server.*;
|
import net.minecraft.server.*;
|
||||||
|
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
@ -129,6 +130,12 @@ public class CraftChunk implements Chunk {
|
|||||||
return getWorld().unloadChunk(getX(), getZ());
|
return getWorld().unloadChunk(getX(), getZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isSlimeChunk() {
|
||||||
|
// 987234911L is deterimined in EntitySlime when seeing if a slime can spawn in a chunk
|
||||||
|
return getHandle().a(987234911L).nextInt(10) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean unload(boolean save) {
|
public boolean unload(boolean save) {
|
||||||
return getWorld().unloadChunk(getX(), getZ(), save);
|
return getWorld().unloadChunk(getX(), getZ(), save);
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren