當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。