Update Upstream
This commit is contained in:
@@ -1,22 +1,23 @@
|
||||
From 1ed95fc07f6d3e686f998625d821320a3419b70d Mon Sep 17 00:00:00 2001
|
||||
From 4f3dd333bb40e8c41894462cb63dfde6cf8b9bf7 Mon Sep 17 00:00:00 2001
|
||||
From: cswhite2000 <18whitechristop@gmail.com>
|
||||
Date: Tue, 21 Aug 2018 19:39:46 -0700
|
||||
Subject: [PATCH] isChunkGenerated API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
|
||||
index e546407e..7713f183 100644
|
||||
index 6dc39989..4e69f277 100644
|
||||
--- a/src/main/java/org/bukkit/Location.java
|
||||
+++ b/src/main/java/org/bukkit/Location.java
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.bukkit;
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.bukkit;
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.lang.ref.Reference;
|
||||
import java.lang.ref.WeakReference;
|
||||
+import com.google.common.base.Preconditions; // Paper
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.bukkit.block.Block;
|
||||
@@ -517,6 +518,15 @@ public class Location implements Cloneable, ConfigurationSerializable {
|
||||
public boolean isChunkLoaded() { return world.isChunkLoaded(locToBlock(x) >> 4, locToBlock(z) >> 4); } // Paper
|
||||
@@ -545,6 +546,16 @@ public class Location implements Cloneable, ConfigurationSerializable {
|
||||
public boolean isChunkLoaded() { return this.getWorld().isChunkLoaded(locToBlock(x) >> 4, locToBlock(z) >> 4); } // Paper
|
||||
|
||||
// Paper start
|
||||
+ /**
|
||||
@@ -25,6 +26,7 @@ index e546407e..7713f183 100644
|
||||
+ * @return true if a chunk has been generated at this location
|
||||
+ */
|
||||
+ public boolean isGenerated() {
|
||||
+ World world = this.getWorld();
|
||||
+ Preconditions.checkNotNull(world, "Location has no world!");
|
||||
+ return world.isChunkGenerated(locToBlock(x) >> 4, locToBlock(z) >> 4);
|
||||
+ }
|
||||
@@ -32,10 +34,10 @@ index e546407e..7713f183 100644
|
||||
/**
|
||||
* Sets the position of this Location and returns itself
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 446d91c5..dd51aa31 100644
|
||||
index 4d35efb0..150c5af2 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -203,6 +203,17 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
||||
@@ -204,6 +204,17 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
||||
return getChunkAt((int) chunkKey, (int) (chunkKey >> 32));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user