Commits

Brokkonaut authored and md_5 committed 757d42aef6f
SPIGOT-6729: Add Chunk.isEntitiesLoaded()
No tags

src/main/java/org/bukkit/craftbukkit/CraftChunk.java

Modified
104 104 return "CraftChunk{" + "x=" + getX() + "z=" + getZ() + '}';
105 105 }
106 106
107 107 @Override
108 108 public Block getBlock(int x, int y, int z) {
109 109 validateChunkCoordinates(getHandle().getMinBuildHeight(), getHandle().getMaxBuildHeight(), x, y, z);
110 110
111 111 return new CraftBlock(worldServer, new BlockPosition((this.x << 4) | x, y, (this.z << 4) | z));
112 112 }
113 113
114 + @Override
115 + public boolean isEntitiesLoaded() {
116 + return getCraftWorld().getHandle().entityManager.a(ChunkCoordIntPair.pair(x, z)); // PAIL rename isEntitiesLoaded
117 + }
118 +
114 119 @Override
115 120 public Entity[] getEntities() {
116 121 if (!isLoaded()) {
117 122 getWorld().getChunkAt(x, z); // Transient load for this tick
118 123 }
119 124
120 125 PersistentEntitySectionManager<net.minecraft.world.entity.Entity> entityManager = getCraftWorld().getHandle().entityManager;
121 126 long pair = ChunkCoordIntPair.pair(x, z);
122 127
123 128 if (entityManager.a(pair)) { // PAIL rename isEntitiesLoaded

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut