Search in sources :

Example 1 with EntityDistanceSelector

use of com.builtbroken.mc.prefab.entity.selector.EntityDistanceSelector in project Engine by VoltzEngine-Project.

the class BlastBasic method doEffectOther.

@Override
public void doEffectOther(boolean beforeBlocksPlaced) {
    if (!beforeBlocksPlaced) {
        // TODO wright own version of getEntitiesWithinAABB that takes a filter and cuboid(or Vector3 to Vector3)
        // TODO ensure that the entity is in line of sight
        // TODO ensure that the entity can be pathed by the explosive
        AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(x - size - 1, y - size - 1, z - size - 1, x + size + 1, y + size + 1, z + size + 1);
        List list = world.selectEntitiesWithinAABB(Entity.class, bounds, new EntityDistanceSelector(new Pos(x, y, z), size + 1, true));
        if (list != null && !list.isEmpty()) {
            damageEntities(list, source);
        }
    }
}
Also used : AxisAlignedBB(net.minecraft.util.AxisAlignedBB) Pos(com.builtbroken.mc.lib.transform.vector.Pos) ArrayList(java.util.ArrayList) List(java.util.List) EntityDistanceSelector(com.builtbroken.mc.prefab.entity.selector.EntityDistanceSelector)

Aggregations

Pos (com.builtbroken.mc.lib.transform.vector.Pos)1 EntityDistanceSelector (com.builtbroken.mc.prefab.entity.selector.EntityDistanceSelector)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 AxisAlignedBB (net.minecraft.util.AxisAlignedBB)1