@Override public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e ) { final double onePixel = 2.0 / 16.0; out.add( new AxisAlignedBB( onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel ) ); } }
@Override public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e ) { out.add( new AxisAlignedBB( 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 ) ); }
@Override public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e ) { out.add( new AxisAlignedBB( 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 ) ); }
@Override public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final BlockPos pos, final Entity thePlayer, final boolean b ) { return Collections.singletonList( new AxisAlignedBB( 0.25, 0, 0.25, 0.75, 0.5, 0.75 ) ); }
@Override public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e ) { for( final AxisAlignedBB bx : this.getSelectedBoundingBoxesFromPool( w, pos, e, false ) ) { out.add( new AxisAlignedBB( bx.minX, bx.minY, bx.minZ, bx.maxX, bx.maxY, bx.maxZ ) ); } }
@Override @SideOnly(Side.CLIENT) public AxisAlignedBB getRenderBoundingBox() { return new AxisAlignedBB(pos.getX(), pos.getY() - 1, pos.getZ(), pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1); }
@Nonnull @Override @SideOnly(Side.CLIENT) public AxisAlignedBB getRenderBoundingBox() { return new AxisAlignedBB(pos.getX(), pos.getY() - 1, pos.getZ(), pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1); }
@Nonnull @Override public AxisAlignedBB getRenderBoundingBox() { if(minPos == null || maxPos == null) { return super.getRenderBoundingBox(); } return new AxisAlignedBB(minPos.getX(), minPos.getY(), minPos.getZ(), maxPos.getX() + 1, maxPos.getY() + 1, maxPos.getZ() + 1); }
public static <T> List<T> getEntitiesAround(Class<? extends T> clazz, World world, double x, double y, double z) { int r = SPARK_SCAN_RANGE; List entities = world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(x - r, y - r, z - r, x + r, y + r, z + r), Predicates.instanceOf(clazz)); return entities; }
/** * Gets the spark attached to the block in the coords passed in. Note that the coords passed * in are for the block that the spark will be on, not the coords of the spark itself. */ public static ICorporeaSpark getSparkForBlock(World world, BlockPos pos) { List<Entity> sparks = world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos.up(), pos.add(1, 2, 1)), Predicates.instanceOf(ICorporeaSpark.class)); return sparks.isEmpty() ? null : (ICorporeaSpark) sparks.get(0); }
public List<ItemStack> getFilter() { List<ItemStack> filter = new ArrayList<>(); for(EnumFacing dir : EnumFacing.HORIZONTALS) { List<EntityItemFrame> frames = world.getEntitiesWithinAABB(EntityItemFrame.class, new AxisAlignedBB(pos.offset(dir), pos.offset(dir).add(1, 1, 1))); for(EntityItemFrame frame : frames) { EnumFacing orientation = frame.facingDirection; if(orientation == dir) filter.add(frame.getDisplayedItem()); } } return filter; }
@Override public ISparkEntity getAttachedSpark() { List sparks = world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos.up(), pos.up().add(1, 1, 1)), Predicates.instanceOf(ISparkEntity.class)); if(sparks.size() == 1) { Entity e = (Entity) sparks.get(0); return (ISparkEntity) e; } return null; }
private AxisAlignedBB getPortalAABB() { AxisAlignedBB aabb = new AxisAlignedBB(pos.add(-1, 1, 0), pos.add(2, 4, 1)); if(world.getBlockState(getPos()).getValue(BotaniaStateProps.ALFPORTAL_STATE) == AlfPortalState.ON_X) aabb = new AxisAlignedBB(pos.add(0, 1, -1), pos.add(1, 4, 2)); return aabb; }
@Override public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final BlockPos pos, final Entity thePlayer, final boolean b ) { final EnumFacing up = this.getOrientable( w, pos ).getUp(); final double xOff = -0.3 * up.getFrontOffsetX(); final double yOff = -0.3 * up.getFrontOffsetY(); final double zOff = -0.3 * up.getFrontOffsetZ(); return Collections.singletonList( new AxisAlignedBB( xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7 ) ); }
@Override public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e ) { final double xOff = -0.15 * this.getUp().getFrontOffsetX(); final double yOff = -0.15 * this.getUp().getFrontOffsetY(); final double zOff = -0.15 * this.getUp().getFrontOffsetZ(); out.add( new AxisAlignedBB( xOff + 0.15, yOff + 0.15, zOff + 0.15, // ahh xOff + 0.85, yOff + 0.85, zOff + 0.85 ) ); }
@Override public boolean isTriggerActive(IStatementContainer source, IStatementParameter[] parameters) { World world = source.getTile().getWorld(); int x = source.getTile().getPos().getX(), y = source.getTile().getPos().getY(), z = source.getTile().getPos().getZ(); boolean output = world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(x, y, z, x + 1, y + 1, z + 1), Predicates.instanceOf(IManaBurst.class)).size() != 0; if(output) for(int i = 0; i < 4; i++) Botania.proxy.sparkleFX(x + Math.random(), y + Math.random(), z + Math.random(), 1F, 0.2F, 0.2F, 0.7F + 0.5F * (float) Math.random(), 5); return output; }
@Override public RadiusDescriptor getRadius() { AxisAlignedBB aabb = aabbForOrientation(); aabb = new AxisAlignedBB(aabb.minX, supertile.getPos().getY(), aabb.minZ, aabb.maxX, aabb.maxY, aabb.maxZ); return new RadiusDescriptor.Rectangle(toBlockPos(), aabb); }
public BlockTinyTNT() { super( Material.TNT ); this.boundingBox = new AxisAlignedBB( 0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f ); this.setLightOpacity( 2 ); this.setFullSize( false ); this.setOpaque( false ); this.setSoundType( SoundType.GROUND ); this.setHardness( 0F ); }
public BlockQuantumBase( final Material mat ) { super( mat ); final float shave = 2.0f / 16.0f; this.boundingBox = new AxisAlignedBB( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave ); this.setLightOpacity( 0 ); this.setFullSize( this.setOpaque( false ) ); this.setDefaultState( this.getDefaultState().withProperty( FORMED, false ) ); }
@SubscribeEvent public void onSpawn(LivingSpawnEvent.CheckSpawn event) { if(event.getResult() != Result.ALLOW && event.getEntityLiving() instanceof IMob) { AxisAlignedBB aabb = new AxisAlignedBB(event.getX() - RANGE, event.getY() - RANGE, event.getZ() - RANGE, event.getX() + RANGE, event.getY() + RANGE, event.getZ() + RANGE); for(EntityPlayer player : event.getWorld().playerEntities) { if(hasEffect(player) && !hasEffect(player, ModPotions.emptiness) && player.getEntityBoundingBox().intersects(aabb)) { event.setResult(Result.ALLOW); return; } } } }