mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-31 20:22:05 -07:00
Ensure mobs don't spawn out of world border
this is originally what I thought #1333 was, but wasn't, but this is still valid fix
This commit is contained in:
@@ -6,7 +6,7 @@ Subject: [PATCH] Optimize World.isLoaded(BlockPosition)Z
|
||||
Reduce method invocations for World.isLoaded(BlockPosition)Z
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 0fd91a687e..0cf5d80899 100644
|
||||
index 3740cdf95d..785611f0e2 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
@@ -18,6 +18,6 @@ index 0fd91a687e..0cf5d80899 100644
|
||||
+ }
|
||||
+
|
||||
// Paper start
|
||||
public Chunk getChunkIfLoaded(BlockPosition blockposition) {
|
||||
return getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4);
|
||||
public boolean isLoadedAndInBounds(BlockPosition blockposition) {
|
||||
return getWorldBorder().isInBounds(blockposition) && getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4) != null;
|
||||
--
|
Reference in New Issue
Block a user