当前位置: 首页>>代码示例>>Java>>正文


Java Location.getZ方法代码示例

本文整理汇总了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);
	}
}
 
开发者ID:thekeenant,项目名称:mczone,代码行数:23,代码来源:ConfigAPI.java

示例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;
}
 
开发者ID:benNek,项目名称:AsgardAscension,代码行数:8,代码来源:Convert.java

示例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);

    }
}
 
开发者ID:SamaGames,项目名称:SurvivalAPI,代码行数:41,代码来源:RunBasedSoloGame.java

示例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();
}
 
开发者ID:Shynixn,项目名称:BlockBall,代码行数:9,代码来源:BungeeCordSignInfo.java

示例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);
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:9,代码来源:Locations.java

示例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);
    }
}
 
开发者ID:Kneesnap,项目名称:Kineticraft,代码行数:16,代码来源:ParticleUtils.java

示例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;
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:16,代码来源:LoggerEntityHuman.java

示例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));
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:9,代码来源:NMSHacks.java

示例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();
}
 
开发者ID:Shynixn,项目名称:AstralEdit,代码行数:17,代码来源:LocationBuilder.java

示例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);
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:8,代码来源:NMSHacks.java

示例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());
}
 
开发者ID:Dytanic,项目名称:CloudNet,代码行数:5,代码来源:SignSelector.java

示例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());
}
 
开发者ID:Dytanic,项目名称:CloudNet,代码行数:5,代码来源:MobSelector.java

示例13: LocToString

import org.bukkit.Location; //导入方法依赖的package包/类
public static String LocToString(Location loc) {
	return loc.getWorld().getName() + ":" + loc.getX() + ":" + loc.getY() + ":" + loc.getZ();
}
 
开发者ID:RoboTricker,项目名称:Transport-Pipes,代码行数:4,代码来源:LocationUtils.java

示例14: serialize

import org.bukkit.Location; //导入方法依赖的package包/类
private String serialize(Location loc) {
    return loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ", " + loc.getWorld().getName();
}
 
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:4,代码来源:MobSpawnCommand.java

示例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();
}
 
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:4,代码来源:WarpManager.java


注:本文中的org.bukkit.Location.getZ方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。