@Override
  public void setBlockBoundsBasedOnState(IBlockAccess blockAccess, int x, int y, int z) {

    TEGenericControl te = (TEGenericControl) blockAccess.getTileEntity(x, y, z);
    if (te != null) {
      ForgeDirection dir = te.getDirection();
      te.setDirection(dir);
      setBlockBounds(AABBUtils.rotate(defaultBoundingBox.copy(), Utilities.dirToMeta(dir)));
    }
  }
Exemplo n.º 2
0
  @Override
  public AxisAlignedBB[] getBoundingBox(
      IBlockAccess world, int x, int y, int z, BoundingBoxType type) {
    RustyHatchTileEntity te =
        TileEntityUtils.getTileEntity(RustyHatchTileEntity.class, world, x, y, z);
    if (te == null || te.isMoving() || te.getMovement() == null || te.getMultiBlock() == null)
      return AABBUtils.identities();

    AxisAlignedBB aabb = te.getMovement().getBoundingBox(te, te.isTopBlock(x, y, z), type);
    if (aabb != null) aabb.offset(-x, -y, -z);
    return new AxisAlignedBB[] {aabb};
  }