Search in sources :

Example 1 with TileEntityBeacon

use of net.minecraft.server.v1_12_R1.TileEntityBeacon in project PaperDev by Kamillaova.

the class CraftBeacon method getEntitiesInRange.

@Override
public Collection<LivingEntity> getEntitiesInRange() {
    TileEntity tileEntity = this.getTileEntityFromWorld();
    if (tileEntity instanceof TileEntityBeacon) {
        TileEntityBeacon beacon = (TileEntityBeacon) tileEntity;
        Collection<EntityHuman> nms = beacon.getHumansInRange();
        Collection<LivingEntity> bukkit = new ArrayList<LivingEntity>(nms.size());
        for (EntityHuman human : nms) {
            bukkit.add(human.getBukkitEntity());
        }
        return bukkit;
    }
    // block is no longer a beacon
    return new ArrayList<LivingEntity>();
}
Also used : TileEntity(net.minecraft.server.v1_12_R1.TileEntity) LivingEntity(org.bukkit.entity.LivingEntity) TileEntityBeacon(net.minecraft.server.v1_12_R1.TileEntityBeacon) EntityHuman(net.minecraft.server.v1_12_R1.EntityHuman) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 EntityHuman (net.minecraft.server.v1_12_R1.EntityHuman)1 TileEntity (net.minecraft.server.v1_12_R1.TileEntity)1 TileEntityBeacon (net.minecraft.server.v1_12_R1.TileEntityBeacon)1 LivingEntity (org.bukkit.entity.LivingEntity)1