13
0
geforkt von Mirrors/Paper

SPIGOT-3037: WorldBorder#isInside(Location)

By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2017-01-26 11:16:39 +11:00
Ursprung ca9bfb2d1f
Commit b05bba2d39

Datei anzeigen

@ -1,5 +1,7 @@
package org.bukkit.craftbukkit; package org.bukkit.craftbukkit;
import com.google.common.base.Preconditions;
import net.minecraft.server.BlockPosition;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.WorldBorder; import org.bukkit.WorldBorder;
@ -108,4 +110,11 @@ public class CraftWorldBorder implements WorldBorder {
public void setWarningDistance(int distance) { public void setWarningDistance(int distance) {
this.handle.setWarningDistance(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()));
}
} }