From dbf4ecf30f92708c124aadd08461a4b8a88c7e2f Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 26 Jan 2017 11:16:39 +1100 Subject: [PATCH] SPIGOT-3037: WorldBorder#isInside(Location) --- .../java/org/bukkit/craftbukkit/CraftWorldBorder.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorldBorder.java b/src/main/java/org/bukkit/craftbukkit/CraftWorldBorder.java index e5395a1ccb..403c854c4d 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())); + } }