@Nonnull @Override public AxisAlignedBB getBoundingBox(IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos) { return AABB.offset(state.getOffset(world, pos)); }
@Nonnull @Override public AxisAlignedBB getBoundingBox(IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos) { return AABB.offset(state.getOffset(world, pos)); }
@Override public AxisAlignedBB getWireframeAABB(World world, BlockPos pos) { return FULL_BLOCK_AABB.offset(pos).shrink(1.0/16.0); }
@SuppressWarnings( "deprecation" ) @Override public void addCollisionBoxToList( final IBlockState state, final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, @Nullable final Entity e, boolean p_185477_7_ ) { final ICustomCollision collisionHandler = this.getCustomCollision( w, pos ); if( collisionHandler != null && bb != null ) { final List<AxisAlignedBB> tmp = new ArrayList<>(); collisionHandler.addCollidingBlockToList( w, pos, bb, tmp, e ); for( final AxisAlignedBB b : tmp ) { final AxisAlignedBB offset = b.offset( pos.getX(), pos.getY(), pos.getZ() ); if( bb.intersects( offset ) ) { out.add( offset ); } } } else { super.addCollisionBoxToList( state, w, pos, bb, out, e, p_185477_7_ ); } }
break drawWireframe; axis = axis.offset(-pos.getX(), -pos.getY(), -(pos.getZ() + 1));
if(e instanceof EntityMagicLandmine) { BlockPos bpos = e.getPosition(); AxisAlignedBB aabb = new AxisAlignedBB(bpos).offset(0, offY, 0).grow(2.5, 0, 2.5);
@Override public boolean bindTo(EntityPlayer player, ItemStack wand, BlockPos pos, EnumFacing side) { Vector3 thisVec = Vector3.fromTileEntityCenter(this); Vector3 blockVec = new Vector3(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); AxisAlignedBB axis = player.world.getBlockState(pos).getCollisionBoundingBox(player.world, pos); if(axis != null) axis = axis.offset(pos); else axis = new AxisAlignedBB(pos, pos.add(1, 1, 1)); if(!blockVec.isInside(axis)) blockVec = new Vector3(axis.minX + (axis.maxX - axis.minX) / 2, axis.minY + (axis.maxY - axis.minY) / 2, axis.minZ + (axis.maxZ - axis.minZ) / 2); Vector3 diffVec = blockVec.subtract(thisVec); Vector3 diffVec2D = new Vector3(diffVec.x, diffVec.z, 0); Vector3 rotVec = new Vector3(0, 1, 0); double angle = rotVec.angle(diffVec2D) / Math.PI * 180.0; if(blockVec.x < thisVec.x) angle = -angle; rotationX = (float) angle + 90; rotVec = new Vector3(diffVec.x, 0, diffVec.z); angle = diffVec.angle(rotVec) * 180F / Math.PI; if(blockVec.y < thisVec.y) angle = -angle; rotationY = (float) angle; checkForReceiver(); return true; }
@Override protected int computeRedstoneStrength(World worldIn, BlockPos pos) { AxisAlignedBB axisalignedbb = PRESSURE_AABB.offset(pos); List<? extends Entity> list = getValidEntities(worldIn, axisalignedbb); if(!list.isEmpty()) for(Entity entity : list) if(!entity.doesEntityNotTriggerPressurePlate()) return 15; return 0; }
@Override @SideOnly(Side.CLIENT) public AxisAlignedBB getRenderBoundingBox() { return Block.FULL_BLOCK_AABB.offset(getPos()); } }
List<Entity> list = world.getEntitiesWithinAABBExcludingEntity(this, getEntityBoundingBox().offset(motionX, motionY, motionZ).grow(1.0D)); double d0 = 0.0D; for (int i = 0; i < list.size(); ++i)
AxisAlignedBB aabb = ModBlocks.lightRelay.getBoundingBox(world.getBlockState(pos), world, pos).offset(pos); float range = 0.5F; List<EntityEnderPearl> enderPearls = world.getEntitiesWithinAABB(EntityEnderPearl.class, aabb.grow(range));
@Override public void move(double x, double y, double z) { this.setBoundingBox(this.getBoundingBox().offset(x, y, z)); this.resetPositionToBB(); }
@Override public void move(double x, double y, double z) { this.setBoundingBox(this.getBoundingBox().offset(x, y, z)); this.resetPositionToBB(); }
@Override public void move(double x, double y, double z) { this.setBoundingBox(this.getBoundingBox().offset(x, y, z)); this.resetPositionToBB(); }
@Override @SideOnly(Side.CLIENT) public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World worldIn, BlockPos pos) { IMachineProperties definition = getDefinition(); return definition.getBoundingBox(worldIn, pos, state).offset(pos); }
Vector3 sourceVec = new Vector3(coords.getX() + 0.5, coords.getY() + 0.5, coords.getZ() + 0.5); AxisAlignedBB axis = entity.world.getBlockState(coords).getCollisionBoundingBox(entity.world, coords).offset(coords); if(axis == null) axis = new AxisAlignedBB(coords, coords.add(1, 1, 1));
@Override public AxisAlignedBB getAABB(BlockPos pos) { AxisAlignedBB tempAABB = new AxisAlignedBB(minimumOffset, maximumOffset); return tempAABB.offset(pos.getX(), pos.getY(), pos.getZ()); }
public static boolean isOnGround(@Nonnull EntityCreature entity) { List<AxisAlignedBB> collides = entity.getEntityWorld().getCollisionBoxes(entity, entity.getEntityBoundingBox().offset(0, -0.1, 0)); if (collides.isEmpty()) { return false; } BlockPos groundPos = entity.getPosition().down(); IBlockState bs = entity.getEntityWorld().getBlockState(groundPos); if (bs.getMaterial().isLiquid()) { return false; } return true; }
@Override protected int computeRedstoneStrength(@Nonnull World worldIn, @Nonnull BlockPos pos) { TileEntity te = BlockEnder.getAnyTileEntitySafe(worldIn, pos); if (te instanceof TilePaintedPressurePlate) { EnumPressurePlateType type = ((TilePaintedPressurePlate) te).getType(); return type.getCountingMode() .count(worldIn.getEntitiesWithinAABB(type.getSearchClass(), PRESSURE_AABB.offset(pos), type.getPredicate(getMobType(worldIn, pos)))); } else { return getRedstoneStrength(worldIn.getBlockState(pos)); } }
List<Entity> list = world.getEntitiesWithinAABBExcludingEntity(this, getEntityBoundingBox().offset(motionX*2, motionY*2, motionZ*2).grow(2)); double d0 = 0.0D;