All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.nukkit.positiontracking.NamedPosition Maven / Gradle / Ivy

There is a newer version: 1.20.40-r1
Show newest version
package cn.nukkit.positiontracking;

import cn.nukkit.api.PowerNukkitOnly;
import cn.nukkit.api.Since;
import cn.nukkit.math.Vector3;

import javax.annotation.Nonnull;

/**
 * @author joserobjr
 */
@PowerNukkitOnly
@Since("1.4.0.0-PN")
public abstract class NamedPosition extends Vector3 {
    @PowerNukkitOnly
    @Since("1.4.0.0-PN")
    public NamedPosition() {
    }

    @PowerNukkitOnly
    @Since("1.4.0.0-PN")
    public NamedPosition(double x) {
        super(x);
    }

    @PowerNukkitOnly
    @Since("1.4.0.0-PN")
    public NamedPosition(double x, double y) {
        super(x, y);
    }

    @PowerNukkitOnly
    @Since("1.4.0.0-PN")
    public NamedPosition(double x, double y, double z) {
        super(x, y, z);
    }

    @PowerNukkitOnly
    @Since("1.4.0.0-PN")
    @Nonnull
    public abstract String getLevelName();

    @PowerNukkitOnly
    public boolean matchesNamedPosition(NamedPosition position) {
        return x == position.x && y == position.y && z == position.z && getLevelName().equals(position.getLevelName());
    }

    @Override
    public NamedPosition clone() {
        return (NamedPosition) super.clone();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy