mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 17:57:38 +00:00
Added a new utility method to BukkitUtil to do the common task of shifting coordinates for an entity to the center of a block.
This commit is contained in:
parent
4aaa127efe
commit
1784b29f02
@ -71,6 +71,17 @@ public class BukkitUtil {
|
|||||||
return new Location(world, pt.getX(), pt.getY(), pt.getZ());
|
return new Location(world, pt.getX(), pt.getY(), pt.getZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Location center(Location loc) {
|
||||||
|
return new Location(
|
||||||
|
loc.getWorld(),
|
||||||
|
loc.getBlockX()+0.5,
|
||||||
|
loc.getBlockY()+0.5,
|
||||||
|
loc.getBlockZ()+0.5,
|
||||||
|
loc.getPitch(),
|
||||||
|
loc.getYaw()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public static Player matchSinglePlayer(Server server, String name) {
|
public static Player matchSinglePlayer(Server server, String name) {
|
||||||
List<Player> players = server.matchPlayer(name);
|
List<Player> players = server.matchPlayer(name);
|
||||||
if (players.size() == 0) {
|
if (players.size() == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user