本文整理汇总了Java中org.bukkit.Location.getZ方法的典型用法代码示例。如果您正苦于以下问题:Java Location.getZ方法的具体用法?Java Location.getZ怎么用?Java Location.getZ使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.Location
的用法示例。
在下文中一共展示了Location.getZ方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: set
import org.bukkit.Location; //导入方法依赖的package包/类
public void set(String s, Object o) {
if (o instanceof Location) {
Location l = (Location) o;
String world = l.getWorld().getName();
double x = l.getX();
double y = l.getY();
double z = l.getZ();
double yaw = l.getYaw();
double pitch = l.getPitch();
config.set(s + ".world", world);
config.set(s + ".x", x);
config.set(s + ".y", y);
config.set(s + ".z", z);
config.set(s + ".yaw", yaw);
config.set(s + ".pitch", pitch);
}
else {
config.set(s, o);
}
}
示例2: locationToString
import org.bukkit.Location; //导入方法依赖的package包/类
public static String locationToString(Location loc, boolean yawAndPitch){
String str = loc.getWorld().getName() + ", " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ();
if(yawAndPitch){
str += ", " + loc.getYaw() + ", " + loc.getPitch();
}
return str;
}
示例3: teleportDeathMatch
import org.bukkit.Location; //导入方法依赖的package包/类
/**
* See {@link RunBasedGame}
*/
@Override
public void teleportDeathMatch()
{
Collections.shuffle(this.spawns);
Iterator<Location> locationIterator = this.spawns.iterator();
List<UUID> players = new ArrayList<>();
players.addAll(this.getInGamePlayers().keySet());
for (UUID uuid : players)
{
Player player = Bukkit.getPlayer(uuid);
if (player == null)
{
this.gamePlayers.remove(uuid);
continue;
}
if (!locationIterator.hasNext())
{
player.kickPlayer(ChatColor.RED + "Plus de place dans la partie.");
this.gamePlayers.remove(uuid);
continue;
}
this.removeEffects(player);
Location location = locationIterator.next();
Location destination = new Location(location.getWorld(), location.getX() * 4 / 10, 150.0, location.getZ() * 4 / 10);
ChunkUtils.loadDestination(player, destination, 3);
Bukkit.getScheduler().runTaskLater(plugin, () -> player.teleport(destination), 2);
}
}
示例4: Container
import org.bukkit.Location; //导入方法依赖的package包/类
Container(Location location, String server) {
super();
this.server = server;
this.world = location.getWorld().getName();
this.x = location.getX();
this.y = location.getY();
this.z = location.getZ();
}
示例5: cloneWith
import org.bukkit.Location; //导入方法依赖的package包/类
public static Location cloneWith(Location original, float yaw, float pitch) {
return new Location(original.getWorld(),
original.getX(),
original.getY(),
original.getZ(),
yaw,
pitch);
}
示例6: makeCircle
import org.bukkit.Location; //导入方法依赖的package包/类
/**
* Create a horizonal circle at the given location.
* @param particle
* @param center
* @param radius
*/
public static void makeCircle(Particle particle, Location center, double radius) {
int amount = 100;
for(int i = 0; i < amount; i++) {
double angle = i * ((2 * Math.PI) / amount);
double x = center.getX() + (radius * Math.cos(angle));
double z = center.getZ() + (radius * Math.sin(angle));
center.getWorld().spawnParticle(particle, new Location(center.getWorld(), x, center.getY(), z), 1);
}
}
示例7: LoggerEntityHuman
import org.bukkit.Location; //导入方法依赖的package包/类
private LoggerEntityHuman(Player player, WorldServer world) {
super(MinecraftServer.getServer(), world, new GameProfile(player.getUniqueId(), player.getName()), new PlayerInteractManager((World)world));
Location location = player.getLocation();
double x = location.getX();
double y = location.getY();
double z = location.getZ();
float yaw = location.getYaw();
float pitch = location.getPitch();
new FakePlayerConnection(this);
this.playerConnection.a(x, y, z, yaw, pitch);
EntityPlayer originPlayer = ((CraftPlayer)player).getHandle();
this.lastDamager = originPlayer.lastDamager;
this.invulnerableTicks = originPlayer.invulnerableTicks;
this.combatTracker = originPlayer.combatTracker;
}
示例8: spawnPlayerPacket
import org.bukkit.Location; //导入方法依赖的package包/类
public static Packet spawnPlayerPacket(int entityId, UUID uuid, Location location, Player player) {
return new PacketPlayOutNamedEntitySpawn(entityId,
uuid,
location.getX(), location.getY(), location.getZ(),
encodeAngle(location.getYaw()),
encodeAngle(location.getPitch()),
copyEntityMetadata(player));
}
示例9: LocationBuilder
import org.bukkit.Location; //导入方法依赖的package包/类
/**
* Initializes a new LocationBuilder from the given BukkitLocation
*
* @param location location
*/
public LocationBuilder(Location location) {
super();
if (location == null)
throw new IllegalArgumentException("Location cannot be null!");
this.world = location.getWorld().getName();
this.x = location.getX();
this.y = location.getY();
this.z = location.getZ();
this.yaw = location.getYaw();
this.pitch = location.getPitch();
}
示例10: teleportEntityPacket
import org.bukkit.Location; //导入方法依赖的package包/类
public static Packet teleportEntityPacket(int entityId, Location location) {
return new PacketPlayOutEntityTeleport(entityId,
location.getX(), location.getY(), location.getZ(),
encodeAngle(location.getYaw()),
encodeAngle(location.getPitch()),
true);
}
示例11: toPosition
import org.bukkit.Location; //导入方法依赖的package包/类
public Position toPosition(Location location)
{
return new Position(CloudAPI.getInstance().getGroup(), location.getWorld().getName(), location.getX(), location.getY(), location.getZ());
}
示例12: toPosition
import org.bukkit.Location; //导入方法依赖的package包/类
public MobPosition toPosition(String group, Location location)
{
return new MobPosition(group, location.getWorld().getName(), location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
}
示例13: LocToString
import org.bukkit.Location; //导入方法依赖的package包/类
public static String LocToString(Location loc) {
return loc.getWorld().getName() + ":" + loc.getX() + ":" + loc.getY() + ":" + loc.getZ();
}
示例14: serialize
import org.bukkit.Location; //导入方法依赖的package包/类
private String serialize(Location loc) {
return loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ", " + loc.getWorld().getName();
}
示例15: locToString
import org.bukkit.Location; //导入方法依赖的package包/类
public static String locToString(Location loc) {
return loc.getX() + " " + loc.getY() + " " + loc.getZ() + " " + loc.getYaw() + " " + loc.getPitch() + " " + loc.getWorld().getName();
}