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

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

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

AxisAlignedBB.offset介绍

暂无

代码示例

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

@Nonnull
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos) {
  return AABB.offset(state.getOffset(world, pos));
}

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

@Nonnull
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos) {
  return AABB.offset(state.getOffset(world, pos));
}

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

@Override
public AxisAlignedBB getWireframeAABB(World world, BlockPos pos) {
  return FULL_BLOCK_AABB.offset(pos).shrink(1.0/16.0);
}

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

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

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

break drawWireframe;
axis = axis.offset(-pos.getX(), -pos.getY(), -(pos.getZ() + 1));

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

if(e instanceof EntityMagicLandmine) {
  BlockPos bpos = e.getPosition();
  AxisAlignedBB aabb = new AxisAlignedBB(bpos).offset(0, offY, 0).grow(2.5, 0, 2.5);

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

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

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

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

代码示例来源:origin: WayofTime/BloodMagic

@Override
  @SideOnly(Side.CLIENT)
  public AxisAlignedBB getRenderBoundingBox()
  {
    return Block.FULL_BLOCK_AABB.offset(getPos());
  }
}

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

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)

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

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

代码示例来源:origin: ForestryMC/ForestryMC

@Override
public void move(double x, double y, double z) {
  this.setBoundingBox(this.getBoundingBox().offset(x, y, z));
  this.resetPositionToBB();
}

代码示例来源:origin: ForestryMC/ForestryMC

@Override
public void move(double x, double y, double z) {
  this.setBoundingBox(this.getBoundingBox().offset(x, y, z));
  this.resetPositionToBB();
}

代码示例来源:origin: ForestryMC/ForestryMC

@Override
public void move(double x, double y, double z) {
  this.setBoundingBox(this.getBoundingBox().offset(x, y, z));
  this.resetPositionToBB();
}

代码示例来源:origin: ForestryMC/ForestryMC

@Override
@SideOnly(Side.CLIENT)
public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World worldIn, BlockPos pos) {
  IMachineProperties definition = getDefinition();
  return definition.getBoundingBox(worldIn, pos, state).offset(pos);
}

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

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

代码示例来源:origin: WayofTime/BloodMagic

@Override
public AxisAlignedBB getAABB(BlockPos pos) {
  AxisAlignedBB tempAABB = new AxisAlignedBB(minimumOffset, maximumOffset);
  return tempAABB.offset(pos.getX(), pos.getY(), pos.getZ());
}

代码示例来源:origin: SleepyTrousers/EnderIO

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

代码示例来源:origin: SleepyTrousers/EnderIO

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

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

List<Entity> list = world.getEntitiesWithinAABBExcludingEntity(this, getEntityBoundingBox().offset(motionX*2, motionY*2, motionZ*2).grow(2));
double d0 = 0.0D;

相关文章