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

cn.nukkit.entity.data.EntityData Maven / Gradle / Ivy

Go to download

A Minecraft Bedrock Edition server software implementation made in Java from scratch which supports all new features.

There is a newer version: 1.6.0.1-PN
Show newest version
package cn.nukkit.entity.data;

import java.util.Objects;

/**
 * @author MagicDroidX (Nukkit Project)
 */
public abstract class EntityData {
    private int id;

    protected EntityData(int id) {
        this.id = id;
    }

    public abstract int getType();

    public abstract T getData();

    public abstract void setData(T data);

    public int getId() {
        return id;
    }

    public EntityData setId(int id) {
        this.id = id;
        return this;
    }

    @Override
    public boolean equals(Object obj) {
        return obj instanceof EntityData && ((EntityData) obj).getId() == this.getId() && Objects.equals(((EntityData) obj).getData(), this.getData());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy