Search in sources :

Example 6 with StringFilterEntitySelector

use of pneumaticCraft.common.ai.StringFilterEntitySelector in project PneumaticCraft by MineMaarten.

the class ProgWidgetAreaItemBase method isEntityValid.

public static boolean isEntityValid(Entity entity, IProgWidget widget) {
    StringFilterEntitySelector whitelistFilter = getEntityFilter((ProgWidgetString) widget.getConnectedParameters()[1], true);
    StringFilterEntitySelector blacklistFilter = getEntityFilter((ProgWidgetString) widget.getConnectedParameters()[widget.getParameters().length + 1], false);
    return whitelistFilter.isEntityApplicable(entity) && !blacklistFilter.isEntityApplicable(entity);
}
Also used : StringFilterEntitySelector(pneumaticCraft.common.ai.StringFilterEntitySelector)

Example 7 with StringFilterEntitySelector

use of pneumaticCraft.common.ai.StringFilterEntitySelector in project PneumaticCraft by MineMaarten.

the class ProgWidgetAreaItemBase method getValidEntities.

public static List<Entity> getValidEntities(World world, IProgWidget widget) {
    StringFilterEntitySelector whitelistFilter = getEntityFilter((ProgWidgetString) widget.getConnectedParameters()[1], true);
    StringFilterEntitySelector blacklistFilter = getEntityFilter((ProgWidgetString) widget.getConnectedParameters()[widget.getParameters().length + 1], false);
    return getEntitiesInArea((ProgWidgetArea) widget.getConnectedParameters()[0], (ProgWidgetArea) widget.getConnectedParameters()[widget.getParameters().length], world, whitelistFilter, blacklistFilter);
}
Also used : StringFilterEntitySelector(pneumaticCraft.common.ai.StringFilterEntitySelector)

Aggregations

StringFilterEntitySelector (pneumaticCraft.common.ai.StringFilterEntitySelector)7 ArrayList (java.util.ArrayList)1 Random (java.util.Random)1 Entity (net.minecraft.entity.Entity)1 EntityItem (net.minecraft.entity.item.EntityItem)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 IInventory (net.minecraft.inventory.IInventory)1 ItemStack (net.minecraft.item.ItemStack)1 TileEntity (net.minecraft.tileentity.TileEntity)1 AxisAlignedBB (net.minecraft.util.AxisAlignedBB)1 MovingObjectPosition (net.minecraft.util.MovingObjectPosition)1 Vec3 (net.minecraft.util.Vec3)1 World (net.minecraft.world.World)1