コード例 #1
0
  @Override
  public void onBlockAdded(World worldIn, net.minecraft.util.math.BlockPos pos, IBlockState state) {
    super.onBlockAdded(worldIn, pos, state);
    int rng = Reference.RANDOM.nextInt(3);
    EnumType enumType = EnumType.byMetadata(rng);

    IBlockState outState = state.withProperty(BlockCrystal.PROPERTY_ENUM, enumType);

    worldIn.setBlockState(pos, outState);

    TileSource crystal = (TileSource) worldIn.getTileEntity(pos);
    crystal.setScanMode();
  }