aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0099-Location.isChunkLoaded-API.patch
blob: 426944c4f99cabe276cc4bb87e5d30b82eb0d183 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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
index 7c4db051472fb6a6c6d24092dc6f75487356690a..3be91f6c9b355c9e8562796d719f5a6ce566d85a 100644
--- 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 {
         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) {