Add API to get/set inhabited time of a Chunk

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2019-09-07 16:48:30 +10:00
parent 136363e657
commit 6a3743030e

View file

@ -199,6 +199,18 @@ public class CraftChunk implements Chunk {
return getWorld().getPluginChunkTickets(getX(), getZ()); return getWorld().getPluginChunkTickets(getX(), getZ());
} }
@Override
public long getInhabitedTime() {
return getHandle().q();
}
@Override
public void setInhabitedTime(long ticks) {
Preconditions.checkArgument(ticks >= 0, "ticks cannot be negative");
getHandle().b(ticks);
}
@Override @Override
public ChunkSnapshot getChunkSnapshot() { public ChunkSnapshot getChunkSnapshot() {
return getChunkSnapshot(true, false, false); return getChunkSnapshot(true, false, false);