From 023f438cca4ba1ad2cb56f70ec08b2c602a3c4e2 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 7 Sep 2019 16:48:30 +1000 Subject: [PATCH] Add API to get/set inhabited time of a Chunk --- src/main/java/org/bukkit/craftbukkit/CraftChunk.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java index 9f70019d2f..64e2682643 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java @@ -199,6 +199,18 @@ public class CraftChunk implements Chunk { 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 public ChunkSnapshot getChunkSnapshot() { return getChunkSnapshot(true, false, false);