Search in sources :

Example 1 with Zoglin

use of org.bukkit.entity.Zoglin in project CoreProtect by PlayPro.

the class Bukkit_v1_16 method setEntityMeta.

@Override
public boolean setEntityMeta(Entity entity, Object value, int count) {
    if (entity instanceof Piglin) {
        Piglin piglin = (Piglin) entity;
        if (count == 0) {
            boolean set = (Boolean) value;
            piglin.setBaby(set);
        }
    } else if (entity instanceof Zoglin) {
        Zoglin zoglin = (Zoglin) entity;
        if (count == 0) {
            boolean set = (Boolean) value;
            zoglin.setBaby(set);
        }
    } else if (super.setEntityMeta(entity, value, count)) {
        return true;
    } else {
        return false;
    }
    return true;
}
Also used : Piglin(org.bukkit.entity.Piglin) Zoglin(org.bukkit.entity.Zoglin)

Example 2 with Zoglin

use of org.bukkit.entity.Zoglin in project CoreProtect by PlayPro.

the class Bukkit_v1_16 method getEntityMeta.

@Override
public boolean getEntityMeta(LivingEntity entity, List<Object> info) {
    if (entity instanceof Piglin) {
        Piglin piglin = (Piglin) entity;
        info.add(piglin.isBaby());
    } else if (entity instanceof Zoglin) {
        Zoglin zoglin = (Zoglin) entity;
        info.add(zoglin.isBaby());
    } else if (super.getEntityMeta(entity, info)) {
        return true;
    } else {
        return false;
    }
    return true;
}
Also used : Piglin(org.bukkit.entity.Piglin) Zoglin(org.bukkit.entity.Zoglin)

Aggregations

Piglin (org.bukkit.entity.Piglin)2 Zoglin (org.bukkit.entity.Zoglin)2