コード例 #1
0
  @Override
  public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity) {
    RustyHatchTileEntity te =
        MultiBlock.getOriginProvider(RustyHatchTileEntity.class, world, x, y, z);
    if (te == null) return false;

    return te.shouldLadder(x, y, z);
  }
コード例 #2
0
  @Override
  public boolean onBlockActivated(
      World world,
      int x,
      int y,
      int z,
      EntityPlayer player,
      int side,
      float hitX,
      float hitY,
      float hitZ) {
    if (world.isRemote) return true;

    RustyHatchTileEntity te =
        TileEntityUtils.getTileEntity(RustyHatchTileEntity.class, world, x, y, z);
    if (te == null) return true;

    te.openOrCloseDoor();
    return true;
  }
コード例 #3
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};
  }