net.minecraft.block.Block.withMirror()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(124)

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

Block.withMirror介绍

暂无

代码示例

代码示例来源:origin: DimensionalDevelopment/VanillaFix

@Override
public IBlockState withMirror(Mirror mirror) {
  return block.withMirror(this, mirror);
}

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

@Override
public @Nonnull IBlockState withMirror(@Nonnull IBlockState state, @Nonnull Mirror mirrorIn) {
 return Blocks.DETECTOR_RAIL.withMirror(state, mirrorIn);
}

代码示例来源:origin: DimensionalDevelopment/VanillaFix

@Override
public IBlockState withMirror(Mirror mirrorIn) {
  return normalState.getBlock().withMirror(this, mirrorIn);
}

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

@Override
@SuppressWarnings("deprecation")
public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {
  switch (mirrorIn) {
    case LEFT_RIGHT:
      return state.withProperty(NORTH, state.getValue(SOUTH)).withProperty(SOUTH, state.getValue(NORTH));
    case FRONT_BACK:
      return state.withProperty(EAST, state.getValue(WEST)).withProperty(WEST, state.getValue(EAST));
    default:
      return super.withMirror(state, mirrorIn);
  }
}

代码示例来源:origin: vadis365/TheErebus

@Override
@SuppressWarnings("deprecation")
public IBlockState withMirror(IBlockState state, Mirror mirror) {
  switch (mirror) {
  case LEFT_RIGHT:
    return state.withProperty(NORTH, state.getValue(SOUTH)).withProperty(SOUTH, state.getValue(NORTH));
  case FRONT_BACK:
    return state.withProperty(EAST, state.getValue(WEST)).withProperty(WEST, state.getValue(EAST));
  default:
    return super.withMirror(state, mirror);
  }
}

代码示例来源:origin: JurassiCraftTeam/JurassiCraft2

/**
 * Returns the blockstate with the given mirror of the passed blockstate. If
 * inapplicable, returns the passed blockstate.
 */
public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {
  switch (mirrorIn) {
  case LEFT_RIGHT:
    return state.withProperty(NORTH, state.getValue(SOUTH)).withProperty(SOUTH, state.getValue(NORTH))
        .withProperty(BLOCK_NORTH, state.getValue(BLOCK_SOUTH))
        .withProperty(BLOCK_SOUTH, state.getValue(BLOCK_NORTH));
  case FRONT_BACK:
    return state.withProperty(EAST, state.getValue(WEST)).withProperty(WEST, state.getValue(EAST))
        .withProperty(BLOCK_EAST, state.getValue(BLOCK_WEST))
        .withProperty(BLOCK_WEST, state.getValue(BLOCK_EAST));
  default:
    return super.withMirror(state, mirrorIn);
  }
}

代码示例来源:origin: JurassiCraftTeam/JurassiCraft2

/**
 * Returns the blockstate with the given mirror of the passed blockstate. If
 * inapplicable, returns the passed blockstate.
 */
public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {
  switch (mirrorIn) {
  case LEFT_RIGHT:
    return state.withProperty(NORTH, state.getValue(SOUTH)).withProperty(SOUTH, state.getValue(NORTH))
        .withProperty(BLOCK_NORTH, state.getValue(BLOCK_SOUTH))
        .withProperty(BLOCK_SOUTH, state.getValue(BLOCK_NORTH));
  case FRONT_BACK:
    return state.withProperty(EAST, state.getValue(WEST)).withProperty(WEST, state.getValue(EAST))
        .withProperty(BLOCK_EAST, state.getValue(BLOCK_WEST))
        .withProperty(BLOCK_WEST, state.getValue(BLOCK_EAST));
  default:
    return super.withMirror(state, mirrorIn);
  }
}

相关文章

Block类方法