PaperMC/patches/api/0097-Location.isChunkLoaded-API.patch

19 lines
808 B
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 30 Apr 2018 19:27:31 -0400
Subject: [PATCH] Location.isChunkLoaded() API
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
2023-12-05 18:20:55 +01:00
index 85c342fc50f2fe0ce9a1b3980df9e088c3dea92d..251d26e6870490abd3e915c5e7c06ce1075a24ab 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/Location.java
+++ b/src/main/java/org/bukkit/Location.java
@@ -533,6 +533,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
2021-06-11 14:02:28 +02:00
return this;
}
+ public boolean isChunkLoaded() { return this.getWorld().isChunkLoaded(locToBlock(x) >> 4, locToBlock(z) >> 4); } // Paper
@Override
public boolean equals(Object obj) {
if (obj == null) {