Entity#getChunk API
Get the chunk the entity is currently registered to
This commit is contained in:
parent
aa4a072807
commit
aec70dca41
1 changed files with 12 additions and 0 deletions
|
@ -3,6 +3,7 @@ package org.bukkit.entity;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import org.bukkit.Chunk; // Paper
|
||||||
import org.bukkit.EntityEffect;
|
import org.bukkit.EntityEffect;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Nameable;
|
import org.bukkit.Nameable;
|
||||||
|
@ -812,5 +813,16 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||||
* @return True if entity spawned from a mob spawner
|
* @return True if entity spawned from a mob spawner
|
||||||
*/
|
*/
|
||||||
boolean fromMobSpawner();
|
boolean fromMobSpawner();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the latest chunk an entity is currently or was in.
|
||||||
|
*
|
||||||
|
* @return The current, or most recent chunk if the entity is invalid (which may load the chunk)
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
default Chunk getChunk() {
|
||||||
|
// TODO remove impl here
|
||||||
|
return getLocation().getChunk();
|
||||||
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue