aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-API-Patches/0097-Location.isChunkLoaded-API.patch
blob: d3a1a2a2c76fd98c5770dee928f5b0e780dfd0c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
From d6c9115f6181f8d5f7a3e9e9633726599d1b384e 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 6cffda15..a2dfad2f 100644
--- a/src/main/java/org/bukkit/Location.java
+++ b/src/main/java/org/bukkit/Location.java
@@ -506,6 +506,7 @@ public class Location implements Cloneable, ConfigurationSerializable {
         return this;
     }
 
+    public boolean isChunkLoaded() { return world.isChunkLoaded(locToBlock(x) >> 4, locToBlock(z) >> 4); } // Paper
     @Override
     public boolean equals(Object obj) {
         if (obj == null) {
-- 
2.21.0