diff options
author | md_5 <git@md-5.net> | 2017-01-26 11:16:39 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2017-01-26 11:16:39 +1100 |
commit | dbf4ecf30f92708c124aadd08461a4b8a88c7e2f (patch) | |
tree | af8bf3caa927b5affedfa9eba535c8ec55108200 /src | |
parent | 334aa07e2fcadf347afa38196fd3ab09ca4dc3a7 (diff) | |
download | craftbukkit-dbf4ecf30f92708c124aadd08461a4b8a88c7e2f.tar craftbukkit-dbf4ecf30f92708c124aadd08461a4b8a88c7e2f.tar.gz craftbukkit-dbf4ecf30f92708c124aadd08461a4b8a88c7e2f.tar.lz craftbukkit-dbf4ecf30f92708c124aadd08461a4b8a88c7e2f.tar.xz craftbukkit-dbf4ecf30f92708c124aadd08461a4b8a88c7e2f.zip |
SPIGOT-3037: WorldBorder#isInside(Location)
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftWorldBorder.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorldBorder.java b/src/main/java/org/bukkit/craftbukkit/CraftWorldBorder.java index e5395a1c..403c854c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorldBorder.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorldBorder.java @@ -1,5 +1,7 @@ package org.bukkit.craftbukkit; +import com.google.common.base.Preconditions; +import net.minecraft.server.BlockPosition; import org.bukkit.Location; import org.bukkit.World; import org.bukkit.WorldBorder; @@ -108,4 +110,11 @@ public class CraftWorldBorder implements WorldBorder { public void setWarningDistance(int distance) { this.handle.setWarningDistance(distance); } + + @Override + public boolean isInside(Location location) { + Preconditions.checkArgument(location != null, "location"); + + return location.getWorld().equals(this.world) && this.handle.a(new BlockPosition(location.getX(), location.getY(), location.getZ())); + } } |