9 juin 2015, 16:03

Ah oui, j’avais oublié le titre… Il faut regarder les classes de minecraft avant de demander de l’aide :

  1. Mets ton block extend BlockDirectional
  2. Dans le constructeur, ajoutes ceci :
    this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
    
  3. Ré-écris la fonction onBlockPlaced et rajoutes ceci dedans :
    return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());
    
  4. Ré-écris la fonction getStateFromMeta si tu veux utiliser les metadatas pour orienter ton block
    return ((EnumFacing)state.getValue(FACING)).getHorizontalIndex();
    
  5. Ré-écris la fonction createBlockState
    return new BlockState(this, new IProperty[] {FACING});