mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-16 07:35:35 +01:00
Fix string operation when switching an entity chunk
This commit is contained in:
parent
60e22e9df8
commit
953d84add7
@ -652,9 +652,8 @@ public abstract class Instance implements BlockGetter, BlockSetter, Tickable, Ta
|
|||||||
*/
|
*/
|
||||||
@ApiStatus.Internal
|
@ApiStatus.Internal
|
||||||
public void UNSAFE_addEntityToChunk(@NotNull Entity entity, @NotNull Chunk chunk) {
|
public void UNSAFE_addEntityToChunk(@NotNull Entity entity, @NotNull Chunk chunk) {
|
||||||
Check.notNull(chunk,
|
Check.notNull(chunk, "The chunk {0} is not loaded, you can make it automatic by using Instance#enableAutoChunkLoad(true)", chunk);
|
||||||
"The chunk " + chunk + " is not loaded, you can make it automatic by using Instance#enableAutoChunkLoad(true)");
|
Check.argCondition(!chunk.isLoaded(), "Chunk {0} has been unloaded previously", chunk);
|
||||||
Check.argCondition(!chunk.isLoaded(), "Chunk " + chunk + " has been unloaded previously");
|
|
||||||
final long chunkIndex = ChunkUtils.getChunkIndex(chunk.getChunkX(), chunk.getChunkZ());
|
final long chunkIndex = ChunkUtils.getChunkIndex(chunk.getChunkX(), chunk.getChunkZ());
|
||||||
synchronized (entitiesLock) {
|
synchronized (entitiesLock) {
|
||||||
Set<Entity> entities = getEntitiesInChunk(chunkIndex);
|
Set<Entity> entities = getEntitiesInChunk(chunkIndex);
|
||||||
|
Loading…
Reference in New Issue
Block a user