Regarde la classe de la pumpkin, car là j’en peux plus…
this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
CECI VA DANS LE CONSTRUCTEUR ! Si tu ne sait pas ce qu’est un constructeur : OpenClassrooms
Pour les autres lignes de code, voici le code à rajouter :
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
{
return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());
}
public IBlockState getStateFromMeta(int meta)
{
return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta));
}
public int getMetaFromState(IBlockState state)
{
return ((EnumFacing)state.getValue(FACING)).getHorizontalIndex();
}
protected BlockState createBlockState()
{
return new BlockState(this, new IProperty[] {FACING});
}