net.minecraft.util.math.AxisAlignedBB.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(153)

本文整理了Java中net.minecraft.util.math.AxisAlignedBB.<init>()方法的一些代码示例,展示了AxisAlignedBB.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AxisAlignedBB.<init>()方法的具体详情如下:
包路径:net.minecraft.util.math.AxisAlignedBB
类名称:AxisAlignedBB
方法名:<init>

AxisAlignedBB.<init>介绍

暂无

代码示例

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

@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 ) );
  }
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

@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 ) );
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

@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 ) );
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

@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 ) );
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

@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 ) );
  }
}

代码示例来源:origin: SlimeKnights/TinkersConstruct

@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);
}

代码示例来源:origin: SlimeKnights/TinkersConstruct

@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);
}

代码示例来源:origin: SlimeKnights/TinkersConstruct

@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);
}

代码示例来源:origin: Vazkii/Botania

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;
}

代码示例来源:origin: Vazkii/Botania

/**
 * 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);
}

代码示例来源:origin: Vazkii/Botania

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;
}

代码示例来源:origin: Vazkii/Botania

@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;
}

代码示例来源:origin: Vazkii/Botania

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;
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

@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 ) );
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

@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 ) );
}

代码示例来源:origin: Vazkii/Botania

@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;
}

代码示例来源:origin: Vazkii/Botania

@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);
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

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 );
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

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 ) );
}

代码示例来源:origin: Vazkii/Botania

@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;
      }
    }
  }
}

相关文章