Esempio n. 1
0
  /** returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) */
  @SideOnly(Side.CLIENT)
  public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list) {
    if (itemIn != Item.getItemFromBlock(InitBlocksEA.double_velious_slab)) {
      for (EABlockSlabVelious.EnumType EABlockSlabVelious$enumtype :
          EABlockSlabVelious.EnumType.values()) {

        list.add(new ItemStack(itemIn, 1, EABlockSlabVelious$enumtype.getMetadata()));
      }
    }
  }
Esempio n. 2
0
 public Comparable<?> getTypeForItem(ItemStack stack) {
   return EABlockSlabVelious.EnumType.byMetadata(
       stack.getMetadata()
           &
           // 7
           0);
 }
Esempio n. 3
0
  /** Convert the given metadata into a BlockState for this Block */
  public IBlockState getStateFromMeta(int meta) {
    IBlockState iblockstate =
        this.getDefaultState()
            .withProperty(
                VARIANT,
                EABlockSlabVelious.EnumType.byMetadata(
                    meta
                        &
                        // 7
                        0));

    if (this.isDouble()) {
      iblockstate = iblockstate.withProperty(SEAMLESS, Boolean.valueOf((meta & 8) != 0));
    } else {
      iblockstate =
          iblockstate.withProperty(
              HALF,
              (meta & 8) == 0
                  ? EABlockSlabVelious.EnumBlockHalf.BOTTOM
                  : EABlockSlabVelious.EnumBlockHalf.TOP);
    }

    return iblockstate;
  }
Esempio n. 4
0
 static {
   for (EABlockSlabVelious.EnumType EABlockSlabVelious$enumtype : values()) {
     META_LOOKUP[EABlockSlabVelious$enumtype.getMetadata()] = EABlockSlabVelious$enumtype;
   }
 }