cn.nukkit.entity.data.EntityData Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of powernukkit Show documentation
Show all versions of powernukkit Show documentation
A Minecraft Bedrock Edition server software implementation made in Java from scratch which supports all new features.
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());
}
}